[llvm] [AArch64][SME] Remove implicit-def's on smstart (PR #69012)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 05:50:15 PST 2023


================
@@ -7283,6 +7283,22 @@ static bool checkZExtBool(SDValue Arg, const SelectionDAG &DAG) {
   return ZExtBool;
 }
 
+void AArch64TargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
+                                                          SDNode *Node) const {
+  // Live-in physreg copies that are glued to SMSTART are applied as
+  // implicit-def's in the InstrEmitter. Here we remove them, allowing the
+  // register allocator to pass call args in callee saved regs, without extra
+  // copies to avoid these fake clobbers of actually-preserved GPRs.
+  if (MI.getOpcode() == AArch64::MSRpstatesvcrImm1 ||
+      MI.getOpcode() == AArch64::MSRpstatePseudo)
+    for (unsigned I = MI.getNumOperands() - 1; I > 0; --I)
----------------
sdesmalen-arm wrote:

Doh! Of course, you're right, not sure how I missed that when I made the suggestion :)

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


More information about the llvm-commits mailing list