[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
Sat Nov 21 10:09:21 PST 2026


================
@@ -754,12 +763,26 @@ let Predicates = [HasSVE_or_SME] in {
   defm SQSUB_ZZZ : sve_int_bin_cons_arit_0<0b110, "sqsub", ssubsat>;
   defm UQSUB_ZZZ : sve_int_bin_cons_arit_0<0b111, "uqsub", usubsat>;
 
-  defm AND_ZZZ : sve_int_bin_cons_log<0b00, "and", and>;
+  defm AND_ZZZ : sve_int_bin_cons_log<0b00, "and", AArch64and>;
----------------
pvimal816a wrote:

I understand that there is no AArch64and and AArch64eor. Those are patfrags introduced by me.

The previous version was `defm AND_ZZZ : sve_int_bin_cons_log<0b00, "and", and>;`. So, basically the existing patterns which were part of `sve_int_bin_cons_log` were instantiated for `and` SDNode. Now, I needed to instantiate the patterns additionally for `AArch64and_p` SDNode while still having them instantiated for `and` SDNode as well. So, I created the following patfrag:
```
def AArch64and : PatFrags<(ops node:$op1, node:$op2),
                          [(AArch64and_p srcvalue, node:$op1, node:$op2),
                           (and node:$op1, node:$op2)]>;
```
and replaced `and` with this patfrags.

Is there something I'm missing?

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


More information about the llvm-branch-commits mailing list