[llvm-branch-commits] [llvm] [AArch64][SME] Support Windows/stack probes in MachineSMEABIPass (PR #149063)
Benjamin Maxwell via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jul 18 06:32:45 PDT 2025
================
@@ -465,23 +473,25 @@ void MachineSMEABI::emitAllocateLazySaveBuffer(
auto &Subtarget = MF.getSubtarget<AArch64Subtarget>();
const TargetInstrInfo &TII = *Subtarget.getInstrInfo();
MachineRegisterInfo &MRI = MF.getRegInfo();
+ auto *AFI = MF.getInfo<AArch64FunctionInfo>();
DebugLoc DL = getDebugLoc(MBB, MBBI);
Register SP = MRI.createVirtualRegister(&AArch64::GPR64RegClass);
Register SVL = MRI.createVirtualRegister(&AArch64::GPR64RegClass);
- Register Buffer = MRI.createVirtualRegister(&AArch64::GPR64RegClass);
+ Register Buffer = AFI->getEarlyAllocSMESaveBuffer();
// Calculate SVL.
BuildMI(MBB, MBBI, DL, TII.get(AArch64::RDSVLI_XI), SVL).addImm(1);
// 1. Allocate the lazy save buffer.
- {
+ if (Buffer == AArch64::NoRegister) {
// TODO This function grows the stack with a subtraction, which doesn't work
// on Windows. Some refactoring to share the functionality in
// LowerWindowsDYNAMIC_STACKALLOC will be required once the Windows ABI
// supports SME
----------------
MacDue wrote:
I've rewritten this comment :+1: I think there's still a TODO to improve how this is handled.
https://github.com/llvm/llvm-project/pull/149063
More information about the llvm-branch-commits
mailing list