[llvm] [RISCV] Lower fixed reverse vector_shuffles through vector_reverse (PR #104461)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 10:07:05 PDT 2024


================
@@ -229,10 +229,10 @@ define <32 x i8> @reverse_v32i8(<32 x i8> %a) {
 ; CHECK-LABEL: reverse_v32i8:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    li a0, 32
-; CHECK-NEXT:    lui a1, %hi(.LCPI12_0)
-; CHECK-NEXT:    addi a1, a1, %lo(.LCPI12_0)
 ; CHECK-NEXT:    vsetvli zero, a0, e8, m2, ta, ma
-; CHECK-NEXT:    vle8.v v12, (a1)
+; CHECK-NEXT:    vid.v v10
----------------
topperc wrote:

> For (2), I answered my own question. Our constant lowering doesn't recognize reversed VID.

Is that true? There are many fixed vector reverse tests that already produce a vid.v+vrsub without going through VECTOR_REVERSE. They go through the BUILD_VECTOR lowering and produce vid.v+vrsub.

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


More information about the llvm-commits mailing list