[llvm] [AArch64][SME] Allow SME peephole optimizations across SME pseudos (PR #157655)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 02:43:50 PDT 2025


================
@@ -184,6 +184,11 @@ bool SMEPeepholeOpt::optimizeStartStopPairs(
           isSVERegOp(TRI, MRI, MI.getOperand(1)))
         Prev = nullptr;
       break;
+    case AArch64::RestoreZAPseudo:
+    case AArch64::InOutZAUsePseudo:
+    case AArch64::CommitZASavePseudo:
+    case AArch64::SMEStateAllocPseudo:
+    case AArch64::RequiresZASavePseudo:
----------------
MacDue wrote:

> But what if we have a InOutZAUsePseudo followed by RequiresZASavePseudo? Wouldn't that change the ZA state more globally?

Note: With the order of passes (MachineSMEABI -> SMEPeepholeOpt) the marker nodes don't have any meaning at this stage (they're just leftovers), but I think this may matter for the `Restore/CommitZASavePseudo`. 

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


More information about the llvm-commits mailing list