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

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 12 01:52: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:

minor nit: Can this be an incrementing loop instead?

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


More information about the llvm-commits mailing list