[llvm] [AArch64] Avoid selecting XAR for reverse operations. (PR #178706)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 06:22:44 PST 2026


================
@@ -1068,6 +1068,14 @@ let Predicates = [HasSVE_or_SME] in {
   defm REVH_ZPmZ : sve_int_perm_rev_revh<"revh", AArch64revh_mt>;
   defm REVW_ZPmZ : sve_int_perm_rev_revw<"revw", AArch64revw_mt>;
 
+  def : Pat<(nxv4i32 (or (nxv4i32 (AArch64lsl_p nxv4i1:$pg, nxv4i32:$op, (nxv4i32 (splat_vector (i32 16))))),
+                         (nxv4i32 (AArch64lsr_p nxv4i1:$pg, nxv4i32:$op, (nxv4i32 (splat_vector (i32 16))))))),
----------------
paulwalker-arm wrote:

Yep, that's the correct reading. That said, given `AArch64ISD::REVH_MERGE_PASSTHRU` exists, can this be a DAG combine instead? That way when SVE2p2 is available, we'll use the preferred zeroing version.

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


More information about the llvm-commits mailing list