[llvm] [AArch64][SME] Remove unused ZA lazy-save (PR #81648)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 09:38:52 PDT 2024
================
@@ -2929,6 +2931,80 @@ AArch64TargetLowering::EmitZero(MachineInstr &MI, MachineBasicBlock *BB) const {
return BB;
}
+MachineBasicBlock *
+AArch64TargetLowering::EmitInitTPIDR2Object(MachineInstr &MI,
+ MachineBasicBlock *BB) const {
+ MachineFunction *MF = BB->getParent();
+ MachineFrameInfo &MFI = MF->getFrameInfo();
+ AArch64FunctionInfo *FuncInfo = MF->getInfo<AArch64FunctionInfo>();
+ TPIDR2Object &TPIDR2 = FuncInfo->getTPIDR2Obj();
+ if (TPIDR2.Uses > 0) {
+ const TargetInstrInfo *TII = Subtarget->getInstrInfo();
+ // Store the buffer pointer to the TPIDR2 stack object.
+ BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(AArch64::STRXui))
+ .addReg(MI.getOperand(0).getReg())
+ .addFrameIndex(TPIDR2.FrameIndex)
+ .addImm(0);
+ // Set the reserved bytes (10-15) to zero
+ BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(AArch64::STRHHui))
+ .addReg(AArch64::WZR)
+ .addFrameIndex(TPIDR2.FrameIndex)
+ .addImm(5);
+ BuildMI(*BB, MI, MI.getDebugLoc(), TII->get(AArch64::STRWui))
+ .addReg(AArch64::WZR)
+ .addFrameIndex(TPIDR2.FrameIndex)
+ .addImm(3);
+ } else
+ MFI.RemoveStackObject(TPIDR2.FrameIndex);
+
+ BB->remove_instr(&MI);
+ return BB;
+}
+
+MachineBasicBlock *
+AArch64TargetLowering::EmitExpandZABuffer(MachineInstr &MI,
----------------
sdesmalen-arm wrote:
nit:
```suggestion
AArch64TargetLowering::EmitAllocateZABuffer(MachineInstr &MI,
```
https://github.com/llvm/llvm-project/pull/81648
More information about the llvm-commits
mailing list