[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
Thu Feb 15 09:31:09 PST 2024


================
@@ -957,6 +957,15 @@ bool ShrinkWrap::runOnMachineFunction(MachineFunction &MF) {
   if (!ArePointsInteresting())
     return Changed;
 
+  const TargetLowering *TLI = MF.getSubtarget().getTargetLowering();
----------------
momchil-velikov wrote:

If my reading of `performShrinkWrapping` is correct, the `StackAddressUsed` is conservatively set for blocks that are not suitable for a prologue, not necessarily meaning they computed an SP-based address.
Thus we can set this variable for blocks with NZCV live-in.

Anyway, looking a bit more, I now think the proper place to fix this issue is `TargetFrameLowering::canUseAsPrologue`, so I hopefully fixed it there and I also found another bug:

https://github.com/llvm/llvm-project/pull/81878
https://github.com/llvm/llvm-project/pull/81879


https://github.com/llvm/llvm-project/pull/81676


More information about the llvm-commits mailing list