24void VectorBuilder::handleError(
const char *ErrorMsg)
const {
38Value &VectorBuilder::requestMask() {
45Value &VectorBuilder::requestEVL() {
46 if (ExplicitVectorLength)
47 return *ExplicitVectorLength;
59 return returnWithError<Value *>(
"No VPIntrinsic for this opcode");
63 size_t NumInstParams = InstOpArray.
size();
65 NumInstParams + MaskPosOpt.has_value() + VLenPosOpt.has_value();
70 bool TrailingMaskAndVLen =
71 std::min<size_t>(MaskPosOpt.value_or(NumInstParams),
72 VLenPosOpt.value_or(NumInstParams)) >= NumInstParams;
74 if (TrailingMaskAndVLen) {
77 IntrinParams.
resize(NumVPParams);
79 IntrinParams.
resize(NumVPParams);
81 for (
size_t VPParamIdx = 0, ParamIdx = 0; VPParamIdx < NumVPParams;
83 if ((MaskPosOpt && MaskPosOpt.value_or(NumVPParams) == VPParamIdx) ||
84 (VLenPosOpt && VLenPosOpt.value_or(NumVPParams) == VPParamIdx))
86 assert(ParamIdx < NumInstParams);
87 IntrinParams[VPParamIdx] = InstOpArray[ParamIdx++];
92 IntrinParams[*MaskPosOpt] = &requestMask();
94 IntrinParams[*VLenPosOpt] = &requestEVL();
97 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.
static constexpr uint32_t Opcode
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...
static Constant * get(Type *Ty, uint64_t V, bool IsSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
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=std::nullopt, 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 Function * getDeclarationForParams(Module *M, Intrinsic::ID, Type *ReturnType, ArrayRef< Value * > Params)
Declares a llvm.vp.
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.
LLVM Value Representation.
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.