Skip to content

Commit c835b48

Browse files
committed
[RISCV] Compute liveins for new basic blocks in emitStackProbeInline.
Fixes expensive check failures from #117612.
1 parent dc5236e commit c835b48

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "RISCVMachineFunctionInfo.h"
1515
#include "RISCVSubtarget.h"
1616
#include "llvm/BinaryFormat/Dwarf.h"
17+
#include "llvm/CodeGen/LivePhysRegs.h"
1718
#include "llvm/CodeGen/MachineFrameInfo.h"
1819
#include "llvm/CodeGen/MachineFunction.h"
1920
#include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -2066,6 +2067,8 @@ static void emitStackProbeInline(MachineFunction &MF, MachineBasicBlock &MBB,
20662067
LoopTestMBB->addSuccessor(ExitMBB);
20672068
LoopTestMBB->addSuccessor(LoopTestMBB);
20682069
MBB.addSuccessor(LoopTestMBB);
2070+
// Update liveins.
2071+
fullyRecomputeLiveIns({ExitMBB, LoopTestMBB});
20692072
}
20702073

20712074
void RISCVFrameLowering::inlineStackProbe(MachineFunction &MF,

llvm/test/CodeGen/RISCV/stack-clash-prologue-nounwind.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=riscv64 -mattr=+m -O2 < %s \
2+
; RUN: llc -mtriple=riscv64 -mattr=+m -O2 < %s -verify-machineinstrs \
33
; RUN: | FileCheck %s -check-prefix=RV64I
4-
; RUN: llc -mtriple=riscv32 -mattr=+m -O2 < %s \
4+
; RUN: llc -mtriple=riscv32 -mattr=+m -O2 < %s -verify-machineinstrs \
55
; RUN: | FileCheck %s -check-prefix=RV32I
66

77
; Tests copied from PowerPC.

0 commit comments

Comments
 (0)