[llvm] [SystemZ] Add shrink-wrapping support for ELF prologue/epilogue (PR #225240)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 06:27:53 PDT 2026
MarkVeerasingam wrote:
Thanks @uweigand for the feedback!
I was thinking similar that `HasFP` would need a check, because `%r11` was initialised at the function entry and holds the `FP` for that functions lifetime. Thanks for confirming!
I took you're suggestions and added them to this PR.
- Added `enableShrinkWrapping`. It currently is disabled for `GHC` calling conventions, `"systemz-instrument-function-entry"`, backchain, and stack probing (would appreciate a double check on this)
- Added a guard to `hasFP` addressing you're concerns so it only runs when the prologue is emitted at MF.front().
- When testing with `check-llvm`, I caught a bug. In `SystemZELFFrameLowering::canUseAsPrologue()` reject blocks where the Condition Code register (`SystemZ::CC`) is live-in, since prologue stack adjustment instructions (e.g., `AGHI`/`AGFI`) clobber `CC`.
- Add negative regression tests in `shrinkwrap.ll` covering backchain,
`mcount`, stack probing, and GHC calling convention.
Test suite passing.
Follow-up PRs can explore generalizing scratch registers for backchain/stack probing to re-enable shrink-wrapping for those cases where beneficial.
https://github.com/llvm/llvm-project/pull/225240
More information about the llvm-commits
mailing list