diff --git a/llvm/include/llvm/IR/IntrinsicsRISCV.td b/llvm/include/llvm/IR/IntrinsicsRISCV.td --- a/llvm/include/llvm/IR/IntrinsicsRISCV.td +++ b/llvm/include/llvm/IR/IntrinsicsRISCV.td @@ -140,7 +140,7 @@ // Vectors // The intrinsic does not have any operand that must be extended. -defvar NoSplatOperand = 0xF; +defvar NoScalarOperand = 0xF; // The intrinsic does not have a VL operand. // (e.g., riscv_vmv_x_s and riscv_vfmv_f_s) @@ -150,7 +150,7 @@ // These intrinsics may accept illegal integer values in their llvm_any_ty // operand, so they have to be extended. Intrinsic IntrinsicID = !cast(NAME); - bits<4> SplatOperand = NoSplatOperand; + bits<4> ScalarOperand = NoScalarOperand; bits<5> VLOperand = NoVLOperand; } @@ -449,7 +449,7 @@ [LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty, llvm_anyint_ty], [IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 3; } // For destination vector type is the same as first source vector (with mask). @@ -460,7 +460,7 @@ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty, LLVMMatchType<2>], [ImmArg>, IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 4; } // For destination vector type is the same as first source vector. The @@ -491,7 +491,7 @@ [LLVMMatchType<0>, llvm_anyvector_ty, llvm_any_ty, llvm_anyint_ty], [IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 3; } // For destination vector type is NOT the same as first source vector (with mask). @@ -502,7 +502,7 @@ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty, LLVMMatchType<3>], [ImmArg>, IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 4; } // For destination vector type is NOT the same as first source vector. The @@ -534,7 +534,7 @@ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty], [IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 4; } // For binary operations with mask type output and V0 as input. @@ -546,7 +546,7 @@ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty], [IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 1; + let ScalarOperand = 1; let VLOperand = 3; } // For binary operations with mask type output. @@ -556,7 +556,7 @@ : Intrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>], [llvm_anyvector_ty, llvm_any_ty, llvm_anyint_ty], [IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 1; + let ScalarOperand = 1; let VLOperand = 2; } // For binary operations with mask type output without mask. @@ -566,7 +566,7 @@ : Intrinsic<[LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>], [llvm_anyvector_ty, llvm_any_ty, llvm_anyint_ty], [IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 1; + let ScalarOperand = 1; let VLOperand = 2; } // For binary operations with mask type output with mask. @@ -578,7 +578,7 @@ llvm_anyvector_ty, llvm_any_ty, LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty], [IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 4; } // For FP classify operations. @@ -610,7 +610,7 @@ [LLVMMatchType<0>, LLVMMatchType<0>, llvm_any_ty, llvm_anyint_ty], [IntrNoMem, IntrHasSideEffects]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 3; } // For Saturating binary operations with mask. @@ -622,7 +622,7 @@ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty, LLVMMatchType<2>], [ImmArg>, IntrNoMem, IntrHasSideEffects]>, RISCVVIntrinsic { - let SplatOperand = 2; + let ScalarOperand = 2; let VLOperand = 4; } // For Saturating binary operations. @@ -692,7 +692,7 @@ [LLVMMatchType<0>, llvm_any_ty, LLVMMatchType<0>, llvm_anyint_ty, LLVMMatchType<2>], [ImmArg>, IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 1; + let ScalarOperand = 1; let VLOperand = 3; } // Input: (vector_in, vector_in/scalar, vector_in, mask, vl, policy @@ -702,7 +702,7 @@ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty, LLVMMatchType<2>], [ImmArg>, IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 1; + let ScalarOperand = 1; let VLOperand = 4; } // Input: (vector_in, vector_in/scalar, vector_in, vl, policy) @@ -711,7 +711,7 @@ [LLVMMatchType<0>, llvm_any_ty, llvm_anyvector_ty, llvm_anyint_ty, LLVMMatchType<3>], [ImmArg>, IntrNoMem] >, RISCVVIntrinsic { - let SplatOperand = 1; + let ScalarOperand = 1; let VLOperand = 3; } // Input: (vector_in, vector_in/scalar, vector_in, mask, vl, policy @@ -721,7 +721,7 @@ LLVMScalarOrSameVectorWidth<0, llvm_i1_ty>, llvm_anyint_ty, LLVMMatchType<3>], [ImmArg>, IntrNoMem]>, RISCVVIntrinsic { - let SplatOperand = 1; + let ScalarOperand = 1; let VLOperand = 4; } // For Reduction ternary operations. diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.h b/llvm/lib/Target/RISCV/RISCVISelLowering.h --- a/llvm/lib/Target/RISCV/RISCVISelLowering.h +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.h @@ -685,11 +685,11 @@ struct RISCVVIntrinsicInfo { unsigned IntrinsicID; - uint8_t SplatOperand; + uint8_t ScalarOperand; uint8_t VLOperand; - bool hasSplatOperand() const { - // 0xF is not valid. See NoSplatOperand in IntrinsicsRISCV.td. - return SplatOperand != 0xF; + bool hasScalarOperand() const { + // 0xF is not valid. See NoScalarOperand in IntrinsicsRISCV.td. + return ScalarOperand != 0xF; } bool hasVLOperand() const { // 0x1F is not valid. See NoVLOperand in IntrinsicsRISCV.td. diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -4572,10 +4572,10 @@ const RISCVVIntrinsicsTable::RISCVVIntrinsicInfo *II = RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo(IntNo); - if (!II || !II->hasSplatOperand()) + if (!II || !II->hasScalarOperand()) return SDValue(); - unsigned SplatOp = II->SplatOperand + 1 + HasChain; + unsigned SplatOp = II->ScalarOperand + 1 + HasChain; assert(SplatOp < Op.getNumOperands()); SmallVector Operands(Op->op_begin(), Op->op_end()); @@ -4605,7 +4605,7 @@ // that a widening operation never uses SEW=64. // NOTE: If this fails the below assert, we can probably just find the // element count from any operand or result and use it to construct the VT. - assert(II->SplatOperand > 0 && "Unexpected splat operand!"); + assert(II->ScalarOperand > 0 && "Unexpected splat operand!"); MVT VT = Op.getOperand(SplatOp - 1).getSimpleValueType(); // The more complex case is when the scalar is larger than XLenVT. diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -418,7 +418,7 @@ def RISCVVIntrinsicsTable : GenericTable { let FilterClass = "RISCVVIntrinsic"; let CppTypeName = "RISCVVIntrinsicInfo"; - let Fields = ["IntrinsicID", "SplatOperand", "VLOperand"]; + let Fields = ["IntrinsicID", "ScalarOperand", "VLOperand"]; let PrimaryKey = ["IntrinsicID"]; let PrimaryKeyName = "getRISCVVIntrinsicInfo"; }