Skip to content

Commit d4b1f82

Browse files
committed
[RISCV] Set RegState for the stack-clash prologue registers
Set both prologue scratch registers as InternalRead for stack-clash protection to fix the tests with LLVM_ENABLE_EXPENSIVE_CHECKS. See buildbot failure: https://lab.llvm.org/buildbot/#/builders/16/builds/10433
1 parent e9866d5 commit d4b1f82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@ static void emitStackProbeInline(MachineFunction &MF, MachineBasicBlock &MBB,
20432043
// SUB SP, SP, ProbeSize
20442044
BuildMI(*LoopTestMBB, LoopTestMBB->end(), DL, TII->get(RISCV::SUB), SPReg)
20452045
.addReg(SPReg)
2046-
.addReg(ScratchReg)
2046+
.addReg(ScratchReg, RegState::InternalRead)
20472047
.setMIFlags(Flags);
20482048

20492049
// s[d|w] zero, 0(sp)
@@ -2057,7 +2057,7 @@ static void emitStackProbeInline(MachineFunction &MF, MachineBasicBlock &MBB,
20572057
// BNE SP, TargetReg, LoopTest
20582058
BuildMI(*LoopTestMBB, LoopTestMBB->end(), DL, TII->get(RISCV::BNE))
20592059
.addReg(SPReg)
2060-
.addReg(TargetReg)
2060+
.addReg(TargetReg, RegState::InternalRead)
20612061
.addMBB(LoopTestMBB)
20622062
.setMIFlags(Flags);
20632063

0 commit comments

Comments
 (0)