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

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 15 01:51:01 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:
----------------
gbossu wrote:

I probably need to read through that pass, but the comment on top of that `switch` says that we are searching for instructions that are "agnostic of streaming mode". If we get e.g. a `InOutZAUsePseudo`, we will modify the ZA/SME state, but I guess it's fine given that there is a SMSTOP later on? I.e. the state will be discarded.

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

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


More information about the llvm-commits mailing list