Skip to content

Conversation

@ppenzin
Copy link
Contributor

@ppenzin ppenzin commented Nov 15, 2025

Record callee-saved register locations instead of which register. Use SmallVector of CSRSavedLocation in MBBCFAInfo indexed by the register index. Reorder the declarations to make full type of CSRSavedLocation available.

@github-actions
Copy link

github-actions bot commented Nov 15, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/CodeGen/CFIInstrInserter.cpp --diff_from_common_commit

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from clang-format here.
diff --git a/llvm/lib/CodeGen/CFIInstrInserter.cpp b/llvm/lib/CodeGen/CFIInstrInserter.cpp
index 667928304..20fe26afe 100644
--- a/llvm/lib/CodeGen/CFIInstrInserter.cpp
+++ b/llvm/lib/CodeGen/CFIInstrInserter.cpp
@@ -65,104 +65,104 @@ class CFIInstrInserter : public MachineFunctionPass {
     return insertedCFI;
   }
 
- private:
+private:
 #define INVALID_REG UINT_MAX
 #define INVALID_OFFSET INT_MAX
-   /// contains the location where CSR register is saved.
-   struct CSRSavedLocation {
-     enum Kind { INVALID, REGISTER, CFA_OFFSET };
-     CSRSavedLocation() {
-       K = Kind::INVALID;
-       Reg = 0;
-       Offset = 0;
-     }
-     Kind K;
-     // Dwarf register number
-     unsigned Reg;
-     // CFA offset
-     int64_t Offset;
-     bool isValid() const { return K != Kind::INVALID; }
-     bool operator==(const CSRSavedLocation &RHS) const {
-       switch (K) {
-       case Kind::INVALID:
-         return !RHS.isValid();
-       case Kind::REGISTER:
-         return Reg == RHS.Reg;
-       case Kind::CFA_OFFSET:
-         return Offset == RHS.Offset;
-       }
-       llvm_unreachable("Unknown CSRSavedLocation Kind!");
-     }
-     void dump(raw_ostream &OS) const {
-       switch (K) {
-       case Kind::INVALID:
-         OS << "INVALID";
-         break;
-       case Kind::REGISTER:
-         OS << "In Dwarf register: " << Reg;
-         break;
-       case Kind::CFA_OFFSET:
-         OS << "At CFA offset: " << Offset;
-         break;
-       }
-     }
-   };
-
-   struct MBBCFAInfo {
-     MachineBasicBlock *MBB;
-     /// Value of cfa offset valid at basic block entry.
-     int64_t IncomingCFAOffset = -1;
-     /// Value of cfa offset valid at basic block exit.
-     int64_t OutgoingCFAOffset = -1;
-     /// Value of cfa register valid at basic block entry.
-     unsigned IncomingCFARegister = 0;
-     /// Value of cfa register valid at basic block exit.
-     unsigned OutgoingCFARegister = 0;
-     /// Set of locations where the callee saved registers are at basic block
-     /// entry.
-     SmallVector<CSRSavedLocation> IncomingCSRLocations;
-     /// Set of locations where the callee saved registers are at basic block
-     /// exit.
-     SmallVector<CSRSavedLocation> OutgoingCSRLocations;
-     /// If in/out cfa offset and register values for this block have already
-     /// been set or not.
-     bool Processed = false;
-   };
-
-   /// Contains cfa offset and register values valid at entry and exit of basic
-   /// blocks.
-   std::vector<MBBCFAInfo> MBBVector;
-
-   /// Calculate cfa offset and register values valid at entry and exit for all
-   /// basic blocks in a function.
-   void calculateCFAInfo(MachineFunction &MF);
-   /// Calculate cfa offset and register values valid at basic block exit by
-   /// checking the block for CFI instructions. Block's incoming CFA info
-   /// remains the same.
-   void calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo);
-   /// Update in/out cfa offset and register values for successors of the basic
-   /// block.
-   void updateSuccCFAInfo(MBBCFAInfo &MBBInfo);
-
-   /// Check if incoming CFA information of a basic block matches outgoing CFA
-   /// information of the previous block. If it doesn't, insert CFI instruction
-   /// at the beginning of the block that corrects the CFA calculation rule for
-   /// that block.
-   bool insertCFIInstrs(MachineFunction &MF);
-   /// Return the cfa offset value that should be set at the beginning of a MBB
-   /// if needed. The negated value is needed when creating CFI instructions
-   /// that set absolute offset.
-   int64_t getCorrectCFAOffset(MachineBasicBlock *MBB) {
-     return MBBVector[MBB->getNumber()].IncomingCFAOffset;
-   }
-
-   void reportCFAError(const MBBCFAInfo &Pred, const MBBCFAInfo &Succ);
-   void reportCSRError(const MBBCFAInfo &Pred, const MBBCFAInfo &Succ);
-   /// Go through each MBB in a function and check that outgoing offset and
-   /// register of its predecessors match incoming offset and register of that
-   /// MBB, as well as that incoming offset and register of its successors match
-   /// outgoing offset and register of the MBB.
-   unsigned verify(MachineFunction &MF);
+  /// contains the location where CSR register is saved.
+  struct CSRSavedLocation {
+    enum Kind { INVALID, REGISTER, CFA_OFFSET };
+    CSRSavedLocation() {
+      K = Kind::INVALID;
+      Reg = 0;
+      Offset = 0;
+    }
+    Kind K;
+    // Dwarf register number
+    unsigned Reg;
+    // CFA offset
+    int64_t Offset;
+    bool isValid() const { return K != Kind::INVALID; }
+    bool operator==(const CSRSavedLocation &RHS) const {
+      switch (K) {
+      case Kind::INVALID:
+        return !RHS.isValid();
+      case Kind::REGISTER:
+        return Reg == RHS.Reg;
+      case Kind::CFA_OFFSET:
+        return Offset == RHS.Offset;
+      }
+      llvm_unreachable("Unknown CSRSavedLocation Kind!");
+    }
+    void dump(raw_ostream &OS) const {
+      switch (K) {
+      case Kind::INVALID:
+        OS << "INVALID";
+        break;
+      case Kind::REGISTER:
+        OS << "In Dwarf register: " << Reg;
+        break;
+      case Kind::CFA_OFFSET:
+        OS << "At CFA offset: " << Offset;
+        break;
+      }
+    }
+  };
+
+  struct MBBCFAInfo {
+    MachineBasicBlock *MBB;
+    /// Value of cfa offset valid at basic block entry.
+    int64_t IncomingCFAOffset = -1;
+    /// Value of cfa offset valid at basic block exit.
+    int64_t OutgoingCFAOffset = -1;
+    /// Value of cfa register valid at basic block entry.
+    unsigned IncomingCFARegister = 0;
+    /// Value of cfa register valid at basic block exit.
+    unsigned OutgoingCFARegister = 0;
+    /// Set of locations where the callee saved registers are at basic block
+    /// entry.
+    SmallVector<CSRSavedLocation> IncomingCSRLocations;
+    /// Set of locations where the callee saved registers are at basic block
+    /// exit.
+    SmallVector<CSRSavedLocation> OutgoingCSRLocations;
+    /// If in/out cfa offset and register values for this block have already
+    /// been set or not.
+    bool Processed = false;
+  };
+
+  /// Contains cfa offset and register values valid at entry and exit of basic
+  /// blocks.
+  std::vector<MBBCFAInfo> MBBVector;
+
+  /// Calculate cfa offset and register values valid at entry and exit for all
+  /// basic blocks in a function.
+  void calculateCFAInfo(MachineFunction &MF);
+  /// Calculate cfa offset and register values valid at basic block exit by
+  /// checking the block for CFI instructions. Block's incoming CFA info
+  /// remains the same.
+  void calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo);
+  /// Update in/out cfa offset and register values for successors of the basic
+  /// block.
+  void updateSuccCFAInfo(MBBCFAInfo &MBBInfo);
+
+  /// Check if incoming CFA information of a basic block matches outgoing CFA
+  /// information of the previous block. If it doesn't, insert CFI instruction
+  /// at the beginning of the block that corrects the CFA calculation rule for
+  /// that block.
+  bool insertCFIInstrs(MachineFunction &MF);
+  /// Return the cfa offset value that should be set at the beginning of a MBB
+  /// if needed. The negated value is needed when creating CFI instructions
+  /// that set absolute offset.
+  int64_t getCorrectCFAOffset(MachineBasicBlock *MBB) {
+    return MBBVector[MBB->getNumber()].IncomingCFAOffset;
+  }
+
+  void reportCFAError(const MBBCFAInfo &Pred, const MBBCFAInfo &Succ);
+  void reportCSRError(const MBBCFAInfo &Pred, const MBBCFAInfo &Succ);
+  /// Go through each MBB in a function and check that outgoing offset and
+  /// register of its predecessors match incoming offset and register of that
+  /// MBB, as well as that incoming offset and register of its successors match
+  /// outgoing offset and register of the MBB.
+  unsigned verify(MachineFunction &MF);
 };
 }  // namespace
 

@ppenzin ppenzin changed the title [CodeGen] Support multiple save locations for the same callee-saved register [RISCV][CodeGen] Support multiple save locations for the same callee-saved register Nov 15, 2025
@ppenzin
Copy link
Contributor Author

ppenzin commented Nov 17, 2025

This includes #164477 and would complete it, is part of larger change originally proposed in #90819

Working on clearing test failures.

Previously there was an implicit assumption in the code that a CSR can
only be saved in one location. There can be scenarious where CSR is
saved in different locations.
@ppenzin ppenzin force-pushed the regaloc_shrinkwrap_2 branch from a7a8256 to fa53125 Compare November 18, 2025 23:52
@github-actions
Copy link

🐧 Linux x64 Test Results

  • 166121 tests passed
  • 2839 tests skipped
  • 6 tests failed

Failed Tests

(click on a test name to see its output)

LLVM

LLVM.CodeGen/X86/cfi-inserter-callee-save-register-2.mir
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register-2.mir -mtriple=x86_64-- -verify-cfiinstrs      -run-pass=cfi-instr-inserter 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register-2.mir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register-2.mir -mtriple=x86_64-- -verify-cfiinstrs -run-pass=cfi-instr-inserter
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register-2.mir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register-2.mir:12:10: error: CHECK: expected string not found in input
# | # CHECK: CFI_INSTRUCTION offset $rbp, -16
# |          ^
# | <stdin>:123:7: note: scanning from here
# |  bb.3:
# |       ^
# | <stdin>:126:2: note: possible intended match here
# |  CFI_INSTRUCTION def_cfa $rbp, 16
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register-2.mir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |           118:  CFI_INSTRUCTION restore $r13 
# |           119:  CFI_INSTRUCTION restore $r14 
# |           120:  CFI_INSTRUCTION def_cfa $rsp, 8 
# |           121:  RET 0, killed $rax 
# |           122:   
# |           123:  bb.3: 
# | check:12'0           X error: no match found
# |           124:  successors: %bb.4(0x80000000) 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           125:   
# | check:12'0     ~~
# |           126:  CFI_INSTRUCTION def_cfa $rbp, 16 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:12'1      ?                                 possible intended match
# |           127:  CFI_INSTRUCTION register $r13, $rcx 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           128:  renamable $rdi = IMPLICIT_DEF 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           129:  renamable $rsi = IMPLICIT_DEF 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           130:   
# | check:12'0     ~~
# |           131:  bb.4: 
# | check:12'0     ~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.CodeGen/X86/cfi-inserter-callee-save-register.mir
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register.mir -mtriple=x86_64-- -verify-cfiinstrs      -run-pass=cfi-instr-inserter 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register.mir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register.mir -mtriple=x86_64-- -verify-cfiinstrs -run-pass=cfi-instr-inserter
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register.mir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register.mir:12:10: error: CHECK: expected string not found in input
# | # CHECK: CFI_INSTRUCTION restore $rbx
# |          ^
# | <stdin>:84:7: note: scanning from here
# |  bb.3:
# |       ^
# | <stdin>:85:2: note: possible intended match here
# |  RET 0, $rax
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-callee-save-register.mir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            79:  CFI_INSTRUCTION def_cfa_register $rbp 
# |            80:  CFI_INSTRUCTION offset $rbx, -24 
# |            81:  CFI_INSTRUCTION def_cfa $rsp, 8 
# |            82:  RET 0, $rax 
# |            83:   
# |            84:  bb.3: 
# | check:12'0           X error: no match found
# |            85:  RET 0, $rax 
# | check:12'0     ~~~~~~~~~~~~~
# | check:12'1      ?            possible intended match
# |            86: ... 
# | check:12'0     ~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
not --crash /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir -mtriple=x86_64--      -run-pass=cfi-instr-inserter 2>&1 | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
# executed command: not --crash /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -o - /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir -mtriple=x86_64-- -run-pass=cfi-instr-inserter
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir:13:10: error: CHECK: expected string not found in input
# | # CHECK: Different saved locations for the same CSR
# |          ^
# | <stdin>:1:1: note: scanning from here
# | --- |
# | ^
# | <stdin>:33:1: note: possible intended match here
# | failsVerification: false
# | ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: --- | 
# | check:13'0     X~~~~~ error: no match found
# |             2:  ; ModuleID = '/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir' 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             3:  source_filename = "/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/cfi-inserter-verify-inconsistent-loc.mir" 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             4:  target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5:  target triple = "x86_64-unknown-unknown" 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:   
# | check:13'0     ~~
# |             .
# |             .
# |             .
# |            28: hasEHContTarget: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~
# |            29: hasEHScopes: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~
# |            30: hasEHFunclets: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~
# |            31: isOutlined: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~
# |            32: debugInstrRef: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~
# |            33: failsVerification: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:13'1     ?                         possible intended match
# |            34: tracksDebugUserValues: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            35: registers: [] 
# | check:13'0     ~~~~~~~~~~~~~~
# |            36: liveins: [] 
# | check:13'0     ~~~~~~~~~~~~
# |            37: frameInfo: 
# | check:13'0     ~~~~~~~~~~~
# |            38:  isFrameAddressTaken: false 
# | check:13'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.CodeGen/X86/segmented-stacks-dynamic.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks-dynamic.ll -mcpu=generic -mtriple=i686-linux -verify-machineinstrs | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks-dynamic.ll -check-prefix=X86
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mcpu=generic -mtriple=i686-linux -verify-machineinstrs
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks-dynamic.ll -check-prefix=X86
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks-dynamic.ll:64:13: error: X86-NEXT: expected string not found in input
# | ; X86-NEXT: .cfi_restore %ebp
# |             ^
# | <stdin>:57:9: note: scanning from here
# | .LBB0_1:
# |         ^
# | <stdin>:65:2: note: possible intended match here
# |  .cfi_endproc
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks-dynamic.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           52:  leal -4(%ebp), %esp 
# |           53:  popl %esi 
# |           54:  popl %ebp 
# |           55:  .cfi_def_cfa %esp, 4 
# |           56:  retl 
# |           57: .LBB0_1: 
# | next:64'0             X error: no match found
# |           58:  pushl $4 
# | next:64'0     ~~~~~~~~~~
# |           59:  pushl $12 
# | next:64'0     ~~~~~~~~~~~
# |           60:  calll __morestack 
# | next:64'0     ~~~~~~~~~~~~~~~~~~~
# |           61:  retl 
# | next:64'0     ~~~~~~
# |           62:  jmp .LBB0_2 
# | next:64'0     ~~~~~~~~~~~~~
# |           63: .Lfunc_end0: 
# | next:64'0     ~~~~~~~~~~~~~
# |           64:  .size test_basic, .Lfunc_end0-test_basic 
# | next:64'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           65:  .cfi_endproc 
# | next:64'0     ~~~~~~~~~~~~~~
# | next:64'1      ?             possible intended match
# |           66:  # -- End function 
# | next:64'0     ~~~~~~~~~~~~~~~~~~~
# |           67:  .section ".note.GNU-split-stack","",@progbits 
# | next:64'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           68:  .section ".note.GNU-stack","",@progbits 
# | next:64'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.CodeGen/X86/segmented-stacks.ll
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc < /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks.ll -mcpu=generic -mtriple=i686-linux -verify-machineinstrs | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks.ll -check-prefix=X86-Linux
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -mcpu=generic -mtriple=i686-linux -verify-machineinstrs
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks.ll -check-prefix=X86-Linux
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks.ll:306:19: error: X86-Linux-NEXT: expected string not found in input
# | ; X86-Linux-NEXT: .cfi_restore %esi
# |                   ^
# | <stdin>:65:9: note: scanning from here
# | .LBB1_1:
# |         ^
# | <stdin>:73:2: note: possible intended match here
# |  .cfi_endproc
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/X86/segmented-stacks.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            60:  addl $40, %esp 
# |            61:  .cfi_def_cfa_offset 8 
# |            62:  popl %esi 
# |            63:  .cfi_def_cfa_offset 4 
# |            64:  retl 
# |            65: .LBB1_1: 
# | next:306'0             X error: no match found
# |            66:  pushl $4 
# | next:306'0     ~~~~~~~~~~
# |            67:  pushl $44 
# | next:306'0     ~~~~~~~~~~~
# |            68:  calll __morestack 
# | next:306'0     ~~~~~~~~~~~~~~~~~~~
# |            69:  retl 
# | next:306'0     ~~~~~~
# |            70:  jmp .LBB1_2 
# | next:306'0     ~~~~~~~~~~~~~
# |            71: .Lfunc_end1: 
# | next:306'0     ~~~~~~~~~~~~~
# |            72:  .size test_nested, .Lfunc_end1-test_nested 
# | next:306'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            73:  .cfi_endproc 
# | next:306'0     ~~~~~~~~~~~~~~
# | next:306'1      ?             possible intended match
# |            74:  # -- End function 
# | next:306'0     ~~~~~~~~~~~~~~~~~~~
# |            75:  .globl test_large # -- Begin function test_large 
# | next:306'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            76:  .p2align 4 
# | next:306'0     ~~~~~~~~~~~~
# |            77:  .type test_large,@function 
# | next:306'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            78: test_large: # @test_large 
# | next:306'0     ~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.DebugInfo/MIR/X86/no-cfi-loc.mir
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -start-after=prologepilog -mtriple=x86_64 -use-unknown-locations=Enable /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -start-after=prologepilog -mtriple=x86_64 -use-unknown-locations=Enable /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir -o -
# .---command stderr------------
# | llc: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:295: reference llvm::SmallVectorTemplateCommon<(anonymous namespace)::CFIInstrInserter::CSRSavedLocation>::operator[](size_type) [T = (anonymous namespace)::CFIInstrInserter::CSRSavedLocation]: Assertion `idx < size()' failed.
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -start-after=prologepilog -mtriple=x86_64 -use-unknown-locations=Enable /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir -o -
# | 1.	Running pass 'Function Pass Manager' on module '/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir'.
# | 2.	Running pass 'Check CFA info and insert CFI instructions if needed' on function '@foo'
# |  #0 0x0000000007ebe7a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:834:13
# |  #1 0x0000000007ebbeb5 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:105:18
# |  #2 0x0000000007ebf571 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:426:38
# |  #3 0x00007d5dca802330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
# |  #4 0x00007d5dca85bb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
# |  #5 0x00007d5dca80227e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
# |  #6 0x00007d5dca7e58ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
# |  #7 0x00007d5dca7e581b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
# |  #8 0x00007d5dca7f8517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
# |  #9 0x0000000006ccd74a back /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/CodeGen/MachineBasicBlock.h:359:0
# | #10 0x0000000006ccd74a isReturnBlock /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/CodeGen/MachineBasicBlock.h:982:24
# | #11 0x0000000006ccd74a verify /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/CodeGen/CFIInstrInserter.cpp:509:64
# | #12 0x0000000006ccd74a (anonymous namespace)::CFIInstrInserter::runOnMachineFunction(llvm::MachineFunction&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/CodeGen/CFIInstrInserter.cpp:59:31
# | #13 0x0000000006ec1263 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:0:10
# | #14 0x000000000742f925 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1398:27
# | #15 0x00000000074378d2 llvm::FPPassManager::runOnModule(llvm::Module&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1444:13
# | #16 0x00000000074303cc runOnModule /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1513:27
# | #17 0x00000000074303cc llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:531:44
# | #18 0x0000000004da2c88 compileModule(char**, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/tools/llc/llc.cpp:0:8
# | #19 0x0000000004da0020 main /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/tools/llc/llc.cpp:451:13
# | #20 0x00007d5dca7e71ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
# | #21 0x00007d5dca7e728b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
# | #22 0x0000000004d9baa5 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc+0x4d9baa5)
# `-----------------------------
# error: command failed with exit status: -6
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/DebugInfo/MIR/X86/no-cfi-loc.mir
# `-----------------------------
# error: command failed with exit status: 2

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant