24void VectorBuilder::handleError(
const char *ErrorMsg)
const {
38Value &VectorBuilder::requestMask() {
45Value &VectorBuilder::requestEVL() {
46 if (ExplicitVectorLength)
47 return *ExplicitVectorLength;
51 return *ConstantInt::get(IntTy, StaticVectorLength.
getFixedValue());
59 return returnWithError<Value *>(
"No VPIntrinsic for this opcode");
60 return createVectorInstructionImpl(VPID, ReturnTy, InstOpArray,
Name);
69 "No VPIntrinsic for this reduction");
70 return createVectorInstructionImpl(VPID, ValTy, InstOpArray,
Name);
79 size_t NumInstParams = InstOpArray.
size();
81 NumInstParams + MaskPosOpt.has_value() + VLenPosOpt.has_value();
86 bool TrailingMaskAndVLen =
87 std::min<size_t>(MaskPosOpt.value_or(NumInstParams),
88 VLenPosOpt.value_or(NumInstParams)) >= NumInstParams;
90 if (TrailingMaskAndVLen) {
93 IntrinParams.
resize(NumVPParams);
95 IntrinParams.
resize(NumVPParams);
97 for (
size_t VPParamIdx = 0, ParamIdx = 0; VPParamIdx < NumVPParams;
99 if (MaskPosOpt == VPParamIdx || VLenPosOpt == VPParamIdx)
101 assert(ParamIdx < NumInstParams);
102 IntrinParams[VPParamIdx] = InstOpArray[ParamIdx++];
107 IntrinParams[*MaskPosOpt] = &requestMask();
109 IntrinParams[*VLenPosOpt] = &requestEVL();
112 &
getModule(), VPID, ReturnTy, IntrinParams);
This file contains the declarations of entities that describe floating point environment and related ...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
const Module * getModule() const
Return the module owning the function this basic block belongs to, or nullptr if the function does no...
IntegerType * getInt32Ty()
Fetch the type representing a 32-bit integer.
BasicBlock * GetInsertBlock() const
Value * getAllOnesMask(ElementCount NumElts)
Return an all true boolean vector (mask) with NumElts lanes.
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value * > Args={}, const Twine &Name="", MDNode *FPMathTag=nullptr)
A Module instance is used to store all the information related to an LLVM module.
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
static std::optional< unsigned > getMaskParamPos(Intrinsic::ID IntrinsicID)
static std::optional< unsigned > getVectorLengthParamPos(Intrinsic::ID IntrinsicID)
static Intrinsic::ID getForOpcode(unsigned OC)
The llvm.vp.* intrinsics for this instruction Opcode.
static Function * getOrInsertDeclarationForParams(Module *M, Intrinsic::ID, Type *ReturnType, ArrayRef< Value * > Params)
Declares a llvm.vp.
static Intrinsic::ID getForIntrinsic(Intrinsic::ID Id)
The llvm.vp.
static bool isVPReduction(Intrinsic::ID ID)
LLVM Value Representation.
Value * createSimpleReduction(Intrinsic::ID RdxID, Type *ValTy, ArrayRef< Value * > VecOpArray, const Twine &Name=Twine())
Emit a VP reduction intrinsic call for recurrence kind.
Module & getModule() const
Value * createVectorInstruction(unsigned Opcode, Type *ReturnTy, ArrayRef< Value * > VecOpArray, const Twine &Name=Twine())
constexpr ScalarTy getFixedValue() const
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.