[RISCV] Infer mask type from data type for vector vle and vse intrinsics.
authorCraig Topper <craig.topper@sifive.com>
Thu, 17 Dec 2020 04:55:23 +0000 (20:55 -0800)
committerCraig Topper <craig.topper@sifive.com>
Thu, 17 Dec 2020 04:56:14 +0000 (20:56 -0800)
The mask type should have the same number of elements as the data
type.

Similar to D93409 which did this for arithmetic intrinsics.

llvm/include/llvm/IR/IntrinsicsRISCV.td

index 6513617..f5c933c 100644 (file)
@@ -92,7 +92,8 @@ let TargetPrefix = "riscv" in {
         : Intrinsic<[llvm_anyvector_ty ],
                     [LLVMMatchType<0>,
                      LLVMPointerType<LLVMMatchType<0>>,
-                     llvm_anyvector_ty, llvm_anyint_ty],
+                     LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
+                     llvm_anyint_ty],
                     [NoCapture<ArgIndex<1>>, IntrReadMem]>, RISCVVIntrinsic;
   // For unit stride store
   // Input: (vector_in, pointer, vl)
@@ -108,7 +109,8 @@ let TargetPrefix = "riscv" in {
         : Intrinsic<[],
                     [llvm_anyvector_ty,
                      LLVMPointerType<LLVMMatchType<0>>,
-                     llvm_anyvector_ty, llvm_anyint_ty],
+                     LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>,
+                     llvm_anyint_ty],
                     [NoCapture<ArgIndex<1>>, IntrWriteMem]>, RISCVVIntrinsic;
   // For destination vector type is the same as first source vector.
   // Input: (vector_in, vector_in/scalar_in, vl)