[PATCH] D135596: [AArch64] Canonicalize ZERO_EXTEND to VSELECT

Nicola Lancellotti via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 08:19:42 PDT 2022


NicolaLancellotti marked 2 inline comments as done.
NicolaLancellotti added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td:515
   // zext(cmpeq(x, splat(0))) -> cnot(x)
-  def : Pat<(nxv16i8 (zext (nxv16i1 (AArch64setcc_z (nxv16i1 (SVEAllActive):$Pg), nxv16i8:$Op2, (SVEDup0), SETEQ)))),
+  def : Pat<(nxv16i8 (vselect (nxv16i1 (AArch64setcc_z (nxv16i1 (SVEAllActive):$Pg), nxv16i8:$Op2, (SVEDup0), SETEQ)), (nxv16i8 (splat_vector (i32 1))), (nxv16i8 (splat_vector (i32 0))))),
             (CNOT_ZPmZ_B $Op2, $Pg, $Op2)>;
----------------
paulwalker-arm wrote:
> Does `(SVEDup0)` work here as a shortcut?
I think so, I've just replaced zext with vselect, because of the new lowering.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135596/new/

https://reviews.llvm.org/D135596



More information about the llvm-commits mailing list