[llvm] [CFI][stackprobe] Shrink wrapper select safe prologue insertion block when inline stack probing is enabled (PR #81676)
Momchil Velikov via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 11:12:17 PST 2024
================
@@ -957,6 +957,15 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) {
if (!ArePointsInteresting())
return Changed;
+ const TargetLowering *TLI = MF.getSubtarget().getTargetLowering();
----------------
momchil-velikov wrote:
Suggest placing this whole logic in `performShrinkWrapping` and/or `postShrinkWrapping`.
The test `TLI->isStackProbeInstrDefinedFlagRegLiveIn(Save)` can quickly discard a block as a candidate for prologue/epilogue, so by placing it inside those functions we can avoid iterating over all instructions in a candidate block.
https://github.com/llvm/llvm-project/pull/81676
More information about the llvm-commits
mailing list