[llvm] [RISCV] Set RegState for the stack-clash prologue registers (PR #119451)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 12:31:49 PST 2024


topperc wrote:

This is no the correct fix. This is

```
diff --git a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
index 655de0b4e7eb..1028149bf513 100644
--- a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
@@ -14,6 +14,7 @@
 #include "RISCVMachineFunctionInfo.h"
 #include "RISCVSubtarget.h"
 #include "llvm/BinaryFormat/Dwarf.h"
+#include "llvm/CodeGen/LivePhysRegs.h"
 #include "llvm/CodeGen/MachineFrameInfo.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -2066,6 +2067,8 @@ static void emitStackProbeInline(MachineFunction &MF, MachineBasicBlock &MBB,
   LoopTestMBB->addSuccessor(ExitMBB);
   LoopTestMBB->addSuccessor(LoopTestMBB);
   MBB.addSuccessor(LoopTestMBB);
+  // Update liveins.
+  fullyRecomputeLiveIns({ExitMBB, LoopTestMBB});
 }
```

https://github.com/llvm/llvm-project/pull/119451


More information about the llvm-commits mailing list