[llvm-branch-commits] [llvm] [AArch64] Add patterns to combine SVE AND and XOR to BIC (PR #238442)

Vimal Patel via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 9 01:18:54 PST 2026


================
@@ -560,10 +561,17 @@ def AArch64bic : PatFrags<(ops node:$op1, node:$op2),
                            (and node:$op1, (xor node:$op2, (SVEAllActive))),
                            (AArch64bic_node node:$op1, node:$op2)]>;
 
-// Match AND_U with either data operand order, keeping the predicate unchanged.
-def SVEAndU : PatFrags<(ops node:$pg, node:$a, node:$b),
-                      [(AArch64and_u node:$pg, node:$a, node:$b),
-                       (AArch64and_u node:$pg, node:$b, node:$a)]>;
+// Match `intr` with either data operand order, keeping the predicate unchanged.
+class CommPredBinPatFrags<SDPatternOperator intr>
+  : PatFrags<(ops node:$pg, node:$a, node:$b),
+            [(intr node:$pg, node:$a, node:$b),
+             (intr node:$pg, node:$b, node:$a)]>;
+def SVEAndU : CommPredBinPatFrags<AArch64and_u>;
----------------
pvimal816a wrote:

I think for SVEAndU we don't have existing patfrags and we need to define something like CommPredBinPatFrags that is defined in this PR.

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


More information about the llvm-branch-commits mailing list