[llvm] c835b48 - [RISCV] Compute liveins for new basic blocks in emitStackProbeInline.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 10 12:38:12 PST 2024
Author: Craig Topper
Date: 2024-12-10T12:37:45-08:00
New Revision: c835b48a4d72227b174bcd86f071238a1583803a
URL: https://github.com/llvm/llvm-project/commit/c835b48a4d72227b174bcd86f071238a1583803a
DIFF: https://github.com/llvm/llvm-project/commit/c835b48a4d72227b174bcd86f071238a1583803a.diff
LOG: [RISCV] Compute liveins for new basic blocks in emitStackProbeInline.
Fixes expensive check failures from #117612.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
llvm/test/CodeGen/RISCV/stack-clash-prologue-nounwind.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
index 655de0b4e7eb5d..1028149bf513f4 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});
}
void RISCVFrameLowering::inlineStackProbe(MachineFunction &MF,
diff --git a/llvm/test/CodeGen/RISCV/stack-clash-prologue-nounwind.ll b/llvm/test/CodeGen/RISCV/stack-clash-prologue-nounwind.ll
index 3b2d7f1f9a8ea4..882d0b814063d2 100644
--- a/llvm/test/CodeGen/RISCV/stack-clash-prologue-nounwind.ll
+++ b/llvm/test/CodeGen/RISCV/stack-clash-prologue-nounwind.ll
@@ -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.
More information about the llvm-commits
mailing list