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 VPID = Intrinsic::vp_reduce_add;
72 VPID = Intrinsic::vp_reduce_mul;
75 VPID = Intrinsic::vp_reduce_and;
78 VPID = Intrinsic::vp_reduce_or;
81 VPID = Intrinsic::vp_reduce_xor;
85 VPID = Intrinsic::vp_reduce_fadd;
88 VPID = Intrinsic::vp_reduce_fmul;
91 VPID = Intrinsic::vp_reduce_smax;
94 VPID = Intrinsic::vp_reduce_smin;
97 VPID = Intrinsic::vp_reduce_umax;
100 VPID = Intrinsic::vp_reduce_umin;
103 VPID = Intrinsic::vp_reduce_fmax;
106 VPID = Intrinsic::vp_reduce_fmin;
109 VPID = Intrinsic::vp_reduce_fmaximum;
112 VPID = Intrinsic::vp_reduce_fminimum;
117 return createVectorInstructionImpl(VPID, ValTy, InstOpArray,
Name);
126 size_t NumInstParams = InstOpArray.
size();
128 NumInstParams + MaskPosOpt.has_value() + VLenPosOpt.has_value();
133 bool TrailingMaskAndVLen =
134 std::min<size_t>(MaskPosOpt.value_or(NumInstParams),
135 VLenPosOpt.value_or(NumInstParams)) >= NumInstParams;
137 if (TrailingMaskAndVLen) {
140 IntrinParams.
resize(NumVPParams);
142 IntrinParams.
resize(NumVPParams);
144 for (
size_t VPParamIdx = 0, ParamIdx = 0; VPParamIdx < NumVPParams;
146 if ((MaskPosOpt && MaskPosOpt.value_or(NumVPParams) == VPParamIdx) ||
147 (VLenPosOpt && VLenPosOpt.value_or(NumVPParams) == VPParamIdx))
149 assert(ParamIdx < NumInstParams);
150 IntrinParams[VPParamIdx] = InstOpArray[ParamIdx++];
155 IntrinParams[*MaskPosOpt] = &requestMask();
157 IntrinParams[*VLenPosOpt] = &requestEVL();
160 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=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 * createSimpleTargetReduction(RecurKind Kind, Type *ValTy, ArrayRef< Value * > VecOpArray, const Twine &Name=Twine())
Emit a VP reduction intrinsic call for recurrence kind.
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).
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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.
RecurKind
These are the kinds of recurrences that we support.
@ UMin
Unsigned integer min implemented in terms of select(cmp()).
@ Or
Bitwise or logical OR of integers.
@ FMinimum
FP min with llvm.minimum semantics.
@ Mul
Product of integers.
@ Xor
Bitwise or logical XOR of integers.
@ FMax
FP max implemented in terms of select(cmp()).
@ FMaximum
FP max with llvm.maximum semantics.
@ FMulAdd
Sum of float products with llvm.fmuladd(a * b + sum).
@ SMax
Signed integer max implemented in terms of select(cmp()).
@ And
Bitwise or logical AND of integers.
@ SMin
Signed integer min implemented in terms of select(cmp()).
@ FMin
FP min implemented in terms of select(cmp()).
@ UMax
Unsigned integer max implemented in terms of select(cmp()).