Skip to content

Commit f2302ed

Browse files
[RISCV][GISEL] Fix operand on RISCV::G_VMV_V_V_VL
6bac414 added this opcode with the wrong number of operands. It didn't fail on check-llvm for me or on pre-commit CI, but once committed we got buildbot failures. This patch fixes the definition of the instruction and fixes the failing test.
1 parent f0312d9 commit f2302ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Target/RISCV/RISCVInstrGISel.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def : GINodeEquiv<G_VSLIDEDOWN_VL, riscv_slidedown_vl>;
7070
// Pseudo equivalent to a RISCVISD::VMV_V_V_VL
7171
def G_VMV_V_V_VL : RISCVGenericInstruction {
7272
let OutOperandList = (outs type0:$dst);
73-
let InOperandList = (ins type0:$vec, type2:$vl);
73+
let InOperandList = (ins type0:$passthru, type0:$vec, type1:$vl);
7474
let hasSideEffects = false;
7575
}
7676
def : GINodeEquiv<G_VMV_V_V_VL, riscv_vmv_v_v_vl>;

llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rvv/legalize-insert-subvector.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ body: |
538538
; RV32-NEXT: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
539539
; RV32-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
540540
; RV32-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[READ_VLENB]], [[C1]](s64)
541-
; RV32-NEXT: [[VMV_V_V_VL:%[0-9]+]]:_(<vscale x 4 x s16>) = G_VMV_V_V_VL [[EXTRACT_SUBVECTOR]], [[INSERT_SUBVECTOR]](<vscale x 4 x s16>), [[LSHR]](s64)
541+
; RV32-NEXT: [[VMV_V_V_VL:%[0-9]+]]:_(<vscale x 4 x s16>) = G_VMV_V_V_VL [[EXTRACT_SUBVECTOR]], [[INSERT_SUBVECTOR]], [[LSHR]](s64)
542542
; RV32-NEXT: [[INSERT_SUBVECTOR1:%[0-9]+]]:_(<vscale x 8 x s16>) = G_INSERT_SUBVECTOR [[COPY]], [[VMV_V_V_VL]](<vscale x 4 x s16>), 4
543543
; RV32-NEXT: $v8 = COPY [[INSERT_SUBVECTOR1]](<vscale x 8 x s16>)
544544
; RV32-NEXT: PseudoRET implicit $v8
@@ -556,7 +556,7 @@ body: |
556556
; RV64-NEXT: [[READ_VLENB:%[0-9]+]]:_(s32) = G_READ_VLENB
557557
; RV64-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
558558
; RV64-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[READ_VLENB]], [[C1]](s32)
559-
; RV64-NEXT: [[VMV_V_V_VL:%[0-9]+]]:_(<vscale x 4 x s16>) = G_VMV_V_V_VL [[EXTRACT_SUBVECTOR]], [[INSERT_SUBVECTOR]](<vscale x 4 x s16>), [[LSHR]](s32)
559+
; RV64-NEXT: [[VMV_V_V_VL:%[0-9]+]]:_(<vscale x 4 x s16>) = G_VMV_V_V_VL [[EXTRACT_SUBVECTOR]], [[INSERT_SUBVECTOR]], [[LSHR]](s32)
560560
; RV64-NEXT: [[INSERT_SUBVECTOR1:%[0-9]+]]:_(<vscale x 8 x s16>) = G_INSERT_SUBVECTOR [[COPY]], [[VMV_V_V_VL]](<vscale x 4 x s16>), 4
561561
; RV64-NEXT: $v8 = COPY [[INSERT_SUBVECTOR1]](<vscale x 8 x s16>)
562562
; RV64-NEXT: PseudoRET implicit $v8

0 commit comments

Comments
 (0)