Skip to content

Commit

Permalink
[RISCV] Compute liveins for new basic blocks in emitStackProbeInline.
Browse files Browse the repository at this point in the history
Fixes expensive check failures from #117612.
  • Loading branch information
topperc committed Dec 10, 2024
1 parent dc5236e commit c835b48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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});
}

void RISCVFrameLowering::inlineStackProbe(MachineFunction &MF,
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/CodeGen/RISCV/stack-clash-prologue-nounwind.ll
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv64 -mattr=+m -O2 < %s \
; RUN: llc -mtriple=riscv64 -mattr=+m -O2 < %s -verify-machineinstrs \
; RUN: | FileCheck %s -check-prefix=RV64I
; RUN: llc -mtriple=riscv32 -mattr=+m -O2 < %s \
; RUN: llc -mtriple=riscv32 -mattr=+m -O2 < %s -verify-machineinstrs \
; RUN: | FileCheck %s -check-prefix=RV32I

; Tests copied from PowerPC.
Expand Down

0 comments on commit c835b48

Please sign in to comment.