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

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 4 07:45:58 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))))))),
----------------
rj-jesus wrote:

Thanks for the suggestion - this should now be a combine. I'll open a separate PR for the bswap legalisation changes (I included them in part here for completeness).

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


More information about the llvm-commits mailing list