[llvm] [RISCV] Remove vmv.s.x and vmv.x.s lmul pseudo variants (PR #71501)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 03:08:57 PST 2023


================
@@ -544,36 +544,36 @@ define <64 x i1> @buildvec_mask_v64i1() {
 ; RV32-LMULMAX1-LABEL: buildvec_mask_v64i1:
 ; RV32-LMULMAX1:       # %bb.0:
 ; RV32-LMULMAX1-NEXT:    li a0, 1776
-; RV32-LMULMAX1-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
+; RV32-LMULMAX1-NEXT:    vsetivli zero, 1, e16, m1, ta, ma
 ; RV32-LMULMAX1-NEXT:    vmv.s.x v0, a0
 ; RV32-LMULMAX1-NEXT:    lui a0, 4
 ; RV32-LMULMAX1-NEXT:    addi a0, a0, -1793
 ; RV32-LMULMAX1-NEXT:    vmv.s.x v9, a0
 ; RV32-LMULMAX1-NEXT:    lui a0, 11
 ; RV32-LMULMAX1-NEXT:    addi a0, a0, 1718
 ; RV32-LMULMAX1-NEXT:    vmv.s.x v8, a0
-; RV32-LMULMAX1-NEXT:    vmv1r.v v10, v8
+; RV32-LMULMAX1-NEXT:    vmv.v.v v10, v8
----------------
lukel97 wrote:

This is new to me, but this might actually be an intentional optimisation: In `RISCVInstrInfo::copyPhysRegVector` we actually try to convert vmxr.vs to their vmv.v.v counterparts https://reviews.llvm.org/D103510
Presumably this triggers the change because the LMUL now exactly lines up.
Looks like there's a flag to control this too with `-riscv-prefer-whole-register-move`. Maybe this should become a subtarget feature?

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


More information about the llvm-commits mailing list