[llvm-branch-commits] [llvm] [AArch64][SME] Support agnostic ZA functions in the MachineSMEABIPass (PR #149064)

Gaƫtan Bossu via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 1 08:51:02 PDT 2025


================
@@ -250,6 +286,9 @@ struct MachineSMEABI : public MachineFunctionPass {
     SmallVector<ZAState> BundleStates;
----------------
gbossu wrote:

We are starting to accumulate a lot of state, which makes the code harder to follow as it allows any member function to modify it instead of having clear ins/outs.

I know we discussed that already [here](https://github.com/llvm/llvm-project/pull/149062#discussion_r2276758787), but I feel it would be nice not to delay the refactoring too much. Even having a first step that collects all the info in a struct would help. We could then pass that info around by const ref to any function that needs it. If some info needs to be mutable, then it should not be in the struct, and be a clear in/out parameter.

Doing something like this would clearly decouple the "collection" phase from the "let me correctly handle the state changes" phase.

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


More information about the llvm-branch-commits mailing list