[llvm] [AArch64][SVE] Mark AES instructions commutable. (PR #142919)

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 06:15:08 PDT 2025


================
@@ -9254,7 +9254,9 @@ class sve2_crypto_des_bin_op<bits<2> opc, string asm, ZPRRegOp zprty>
 }
 
 multiclass sve2_crypto_des_bin_op<bits<2> opc, string asm, ZPRRegOp zprty,
-                                  SDPatternOperator op, ValueType vt> {
+                                  SDPatternOperator op, ValueType vt,
+                                  bit commutable = 0> {
+  let isCommutable = commutable in
----------------
rj-jesus wrote:

I tried that first, but the pattern matching gets in the way.
We can't set `isCommutable` unconditionally in `sve2_crypto_des_bin_op` either (just for the instruction def) because SM4E uses the same multiclass.
Is it worth creating a dedicated multiclass just for AES instructions as Neon seems to have?

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


More information about the llvm-commits mailing list