[llvm] [AArch64] Funnel Shift now uses rev32/rev64 instructions (PR #136707)

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 23 04:50:40 PDT 2025


================
@@ -5688,6 +5688,17 @@ def : Pat<(v4i32 (bswap (v4i32 V128:$Rn))),
 def : Pat<(v2i64 (bswap (v2i64 V128:$Rn))),
           (v2i64 (REV64v16i8 (v2i64 V128:$Rn)))>;
 
+// Patterns for funnel shifts to be matched to equivalent REV instructions
+def : Pat<(v2i64 (or (v2i64 (AArch64vshl (v2i64 V128:$Rn), (i32 32))), 
+          (v2i64 (AArch64vlshr (v2i64 V128:$Rn), (i32 32))))), 
----------------
davemgreen wrote:

This is a small nit, but can we do it like:
```
def : Pat<(v2i64 (or (v2i64 (AArch64vshl (v2i64 V128:$Rn), (i32 32))), 
                     (v2i64 (AArch64vlshr (v2i64 V128:$Rn), (i32 32))))),
```

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


More information about the llvm-commits mailing list