[clang] [llvm] [SystemZ] Global Stackprotector and associated location section (PR #169317)
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 26 08:37:36 PST 2026
================
@@ -1805,15 +1777,141 @@ bool SystemZInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
splitAdjDynAlloc(MI);
return true;
- case TargetOpcode::LOAD_STACK_GUARD:
- expandLoadStackGuard(&MI);
+ case SystemZ::MOVE_STACK_GUARD:
+ expandMSGPseudo(MI);
+ return true;
+
+ case SystemZ::COMPARE_STACK_GUARD:
+ expandCSGPseudo(MI);
return true;
default:
return false;
}
}
+namespace {
+Register scavengeAddrReg(MachineInstr &MI, MachineBasicBlock *MBB) {
+ // create fresh RegScavanger instance.
+ RegScavenger RS;
----------------
uweigand wrote:
This is effectively quadratic in number of instructions per basic block, so it's not a good idea to do that in the `ExpandPostRAPseudos` pass by default for everyone. Given that this is just a workaround anyway, I'd rather do either:
- actually fix the underlying bug with earlyclobber
- keep the workaround here, at least the scavenger set up should happen rarely
- use another workaround, e.g. by allocating an *extra* scratch register in those pseudos
https://github.com/llvm/llvm-project/pull/169317
More information about the llvm-commits
mailing list