Skip to content

Commit e18734f

Browse files
committed
[RISCV] Use more precise type constraints for the vmv.v.v and vmv.v.x intrinsics.
We can infer the input type from the result type. For vmv.v.v its the same. For vmv.v.x its the element type.
1 parent 704981b commit e18734f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

llvm/include/llvm/IR/IntrinsicsRISCV.td

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,6 @@ let TargetPrefix = "riscv" in {
294294
let ExtendOperand = 3;
295295
}
296296

297-
// For vmv.v.v, vmv.v.x, vmv.v.i
298-
// Input: (vector_in/scalar_in, vl)
299-
class RISCVUnary : Intrinsic<[llvm_anyvector_ty],
300-
[llvm_any_ty, llvm_anyint_ty],
301-
[IntrNoMem] >, RISCVVIntrinsic {
302-
let ExtendOperand = 1;
303-
}
304-
305297
class RISCVTernaryAAAXNoMask
306298
: Intrinsic<[llvm_anyvector_ty],
307299
[LLVMMatchType<0>, LLVMMatchType<0>, llvm_anyint_ty,
@@ -440,8 +432,14 @@ let TargetPrefix = "riscv" in {
440432
defm vssubu : RISCVSaturatingBinaryAAX;
441433
defm vssub : RISCVSaturatingBinaryAAX;
442434

443-
def int_riscv_vmv_v_v : RISCVUnary;
444-
def int_riscv_vmv_v_x : RISCVUnary;
435+
def int_riscv_vmv_v_v : Intrinsic<[llvm_anyvector_ty],
436+
[LLVMMatchType<0>, llvm_anyint_ty],
437+
[IntrNoMem]>, RISCVVIntrinsic;
438+
def int_riscv_vmv_v_x : Intrinsic<[llvm_anyint_ty],
439+
[LLVMVectorElementType<0>, llvm_anyint_ty],
440+
[IntrNoMem]>, RISCVVIntrinsic {
441+
let ExtendOperand = 1;
442+
}
445443

446444
def int_riscv_vmv_x_s : Intrinsic<[LLVMVectorElementType<0>],
447445
[llvm_anyint_ty],

0 commit comments

Comments
 (0)