[llvm] [RISCV] Recognize VLA shift pairs from shuffle masks (PR #127710)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 19 20:29:26 PST 2025
================
@@ -874,17 +849,12 @@ define <8 x float> @shuffle_v8f32_as_i64(<8 x float> %v) {
;
; ZVKB-ZVE32X-LABEL: shuffle_v8f32_as_i64:
; ZVKB-ZVE32X: # %bb.0:
-; ZVKB-ZVE32X-NEXT: lui a0, %hi(.LCPI27_0)
-; ZVKB-ZVE32X-NEXT: addi a0, a0, %lo(.LCPI27_0)
-; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e16, m2, ta, ma
-; ZVKB-ZVE32X-NEXT: vle8.v v12, (a0)
-; ZVKB-ZVE32X-NEXT: vsext.vf2 v16, v12
-; ZVKB-ZVE32X-NEXT: vsetvli a0, zero, e32, m1, ta, ma
-; ZVKB-ZVE32X-NEXT: vrgatherei16.vv v13, v9, v16
-; ZVKB-ZVE32X-NEXT: vrgatherei16.vv v12, v8, v16
-; ZVKB-ZVE32X-NEXT: vrgatherei16.vv v14, v10, v16
-; ZVKB-ZVE32X-NEXT: vrgatherei16.vv v15, v11, v16
-; ZVKB-ZVE32X-NEXT: vmv4r.v v8, v12
+; ZVKB-ZVE32X-NEXT: li a0, 170
+; ZVKB-ZVE32X-NEXT: vsetivli zero, 8, e32, m4, ta, mu
+; ZVKB-ZVE32X-NEXT: vmv.s.x v0, a0
+; ZVKB-ZVE32X-NEXT: vslidedown.vi v12, v8, 1
+; ZVKB-ZVE32X-NEXT: vslideup.vi v12, v8, 1, v0.t
+; ZVKB-ZVE32X-NEXT: vmv.v.v v8, v12
----------------
lukel97 wrote:
Just a note for myself, even though we're going from 4 x M1 ops (+ change) to 2 x M4 ops, vslides are 4x faster than vrgather.vvs at M1 anyway on the spacemit-x60
https://github.com/llvm/llvm-project/pull/127710
More information about the llvm-commits
mailing list