LLVM: lib/CodeGen/ExpandVectorPredication.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
29#include
30
31using namespace llvm;
32
35
36
37#define VPINTERNAL_VPLEGAL_CASES \
38 VPINTERNAL_CASE(Legal) \
39 VPINTERNAL_CASE(Discard) \
40 VPINTERNAL_CASE(Convert)
41
42#define VPINTERNAL_CASE(X) "|" #X
43
44
48 ". If non-empty, ignore "
49 "TargetTransformInfo and "
50 "always use this transformation for the %evl parameter (Used in "
51 "testing)."));
52
56 ". If non-empty, Ignore "
57 "TargetTransformInfo and "
58 "always use this transformation for the %mask parameter (Used in "
59 "testing)."));
60
61#undef VPINTERNAL_CASE
62#define VPINTERNAL_CASE(X) .Case(#X, VPLegalization::X)
63
67
68#undef VPINTERNAL_VPLEGAL_CASES
69
70
74
75#define DEBUG_TYPE "expandvp"
76
77STATISTIC(NumFoldedVL, "Number of folded vector length params");
78STATISTIC(NumLoweredVPOps, "Number of folded vector predication operations");
79
80
81
82
86 return ConstValue->isAllOnesValue();
87
88 return false;
89}
90
91
94 return ConstantInt::get(DivTy, 1u, false);
95}
96
97
101 return;
102
104 if (!OldFMOp)
105 return;
106
107 NewInst->setFastMathFlags(OldFMOp->getFastMathFlags());
108}
109
110
111
121
123
125 return false;
126
129 .hasAttribute(Attribute::AttrKind::Speculatable);
132 return false;
133}
134
135
136
137namespace {
138
139
140struct CachingVPExpander {
141 const TargetTransformInfo &TTI;
142
143
144
145
146
147
148
149
150
151
152
154 ElementCount ElemCount);
155
156
157
158 bool foldEVLIntoMask(VPIntrinsic &VPI);
159
160
161
162
163 bool discardEVLParameter(VPIntrinsic &PI);
164
165
166 bool expandPredicationInBinaryOperator(IRBuilder<> &Builder, VPIntrinsic &PI);
167
168
169 bool expandPredicationToIntCall(IRBuilder<> &Builder, VPIntrinsic &PI);
170
171
172 bool expandPredicationToFPCall(IRBuilder<> &Builder, VPIntrinsic &PI,
173 unsigned UnpredicatedIntrinsicID);
174
175
176 bool expandPredicationInReduction(IRBuilder<> &Builder,
177 VPReductionIntrinsic &PI);
178
179
180 bool expandPredicationToCastIntrinsic(IRBuilder<> &Builder, VPIntrinsic &VPI);
181
182
183 bool expandPredicationInMemoryIntrinsic(IRBuilder<> &Builder,
184 VPIntrinsic &VPI);
185
186
187 bool expandPredicationInComparison(IRBuilder<> &Builder, VPCmpIntrinsic &PI);
188
189
190 bool expandPredication(VPIntrinsic &PI);
191
192
193
194 VPLegalization getVPLegalizationStrategy(const VPIntrinsic &VPI) const;
195 bool UsingTTIOverrides;
196
197public:
198 CachingVPExpander(const TargetTransformInfo &TTI)
200
201
202
204};
205
206
207
208Value *CachingVPExpander::convertEVLToMask(IRBuilder<> &Builder,
211
212
214 Type *BoolVecTy = VectorType::get(Builder.getInt1Ty(), ElemCount);
215
217 return Builder.CreateIntrinsic(Intrinsic::get_active_lane_mask,
218 {BoolVecTy, EVLParam->getType()},
219 {ConstZero, EVLParam});
220 }
221
222
228}
229
230bool CachingVPExpander::expandPredicationInBinaryOperator(IRBuilder<> &Builder,
231 VPIntrinsic &VPI) {
233 "Implicitly dropping %evl in non-speculatable operator!");
234
237
241
242
244 switch (OC) {
245 default:
246
247 break;
248
249
250 case Instruction::UDiv:
251 case Instruction::SDiv:
252 case Instruction::URem:
253 case Instruction::SRem:
254
256 Op1 = Builder.CreateSelect(Mask, Op1, SafeDivisor);
257 }
258 }
259
261
263 return true;
264}
265
266bool CachingVPExpander::expandPredicationToIntCall(IRBuilder<> &Builder,
267 VPIntrinsic &VPI) {
269 if (!FID)
270 return false;
271 SmallVector<Value *, 2> Argument;
272 for (unsigned i = 0; i < VPI.getNumOperands() - 3; i++) {
274 }
276 Builder.CreateIntrinsic(FID.value(), {VPI.getType()}, Argument);
278 return true;
279}
280
281bool CachingVPExpander::expandPredicationToFPCall(
282 IRBuilder<> &Builder, VPIntrinsic &VPI, unsigned UnpredicatedIntrinsicID) {
284 "Implicitly dropping %evl in non-speculatable operator!");
285
286 switch (UnpredicatedIntrinsicID) {
287 case Intrinsic::fabs:
288 case Intrinsic::sqrt:
289 case Intrinsic::maxnum:
290 case Intrinsic::minnum: {
291 SmallVector<Value *, 2> Argument;
292 for (unsigned i = 0; i < VPI.getNumOperands() - 3; i++) {
294 }
298 return true;
299 }
300 case Intrinsic::fma:
301 case Intrinsic::fmuladd:
302 case Intrinsic::experimental_constrained_fma:
303 case Intrinsic::experimental_constrained_fmuladd: {
308 VPI.getModule(), UnpredicatedIntrinsicID, {VPI.getType()});
312 else
313 NewOp = Builder.CreateCall(Fn, {Op0, Op1, Op2});
315 return true;
316 }
317 }
318
319 return false;
320}
321
322static Value *getNeutralReductionElement(const VPReductionIntrinsic &VPI,
323 Type *EltTy) {
325 FastMathFlags FMF;
329}
330
331bool CachingVPExpander::expandPredicationInReduction(
332 IRBuilder<> &Builder, VPReductionIntrinsic &VPI) {
334 "Implicitly dropping %evl in non-speculatable operator!");
335
338
339
341 auto *NeutralElt = getNeutralReductionElement(VPI, VPI.getType());
344 RedOp = Builder.CreateSelect(Mask, RedOp, NeutralVector);
345 }
346
349
351 default:
353 case Intrinsic::vp_reduce_add:
354 case Intrinsic::vp_reduce_mul:
355 case Intrinsic::vp_reduce_and:
356 case Intrinsic::vp_reduce_or:
357 case Intrinsic::vp_reduce_xor: {
364 break;
365 }
366 case Intrinsic::vp_reduce_smax:
367 case Intrinsic::vp_reduce_smin:
368 case Intrinsic::vp_reduce_umax:
369 case Intrinsic::vp_reduce_umin:
370 case Intrinsic::vp_reduce_fmax:
371 case Intrinsic::vp_reduce_fmin:
372 case Intrinsic::vp_reduce_fmaximum:
373 case Intrinsic::vp_reduce_fminimum: {
379 break;
380 }
381 case Intrinsic::vp_reduce_fadd:
383 break;
384 case Intrinsic::vp_reduce_fmul:
386 break;
387 }
388
390 return true;
391}
392
393bool CachingVPExpander::expandPredicationToCastIntrinsic(IRBuilder<> &Builder,
394 VPIntrinsic &VPI) {
400
402 return true;
403}
404
405bool CachingVPExpander::expandPredicationInMemoryIntrinsic(IRBuilder<> &Builder,
406 VPIntrinsic &VPI) {
408
410
415
417
418 Value *NewMemoryInst = nullptr;
420 default:
422 case Intrinsic::vp_store:
423 if (IsUnmasked) {
424 StoreInst *NewStore =
425 Builder.CreateStore(DataParam, PtrParam, false);
426 if (AlignOpt.has_value())
428 NewMemoryInst = NewStore;
429 } else
431 DataParam, PtrParam, AlignOpt.valueOrOne(), MaskParam);
432
433 break;
434 case Intrinsic::vp_load:
435 if (IsUnmasked) {
436 LoadInst *NewLoad =
437 Builder.CreateLoad(VPI.getType(), PtrParam, false);
438 if (AlignOpt.has_value())
440 NewMemoryInst = NewLoad;
441 } else
444
445 break;
446 case Intrinsic::vp_scatter: {
450 DataParam, PtrParam,
451 AlignOpt.value_or(DL.getPrefTypeAlign(ElementType)), MaskParam);
452 break;
453 }
454 case Intrinsic::vp_gather: {
458 AlignOpt.value_or(DL.getPrefTypeAlign(ElementType)), MaskParam,
459 nullptr);
460 break;
461 }
462 }
463
464 assert(NewMemoryInst);
466 return true;
467}
468
469bool CachingVPExpander::expandPredicationInComparison(IRBuilder<> &Builder,
470 VPCmpIntrinsic &VPI) {
472 "Implicitly dropping %evl in non-speculatable operator!");
473
476
480
481 auto *NewCmp = Builder.CreateCmp(Pred, Op0, Op1);
482
484 return true;
485}
486
487bool CachingVPExpander::discardEVLParameter(VPIntrinsic &VPI) {
488 LLVM_DEBUG(dbgs() << "Discard EVL parameter in " << VPI << "\n");
489
491 return false;
492
494 if (!EVLParam)
495 return false;
496
498 Value *MaxEVL = nullptr;
501
505 MaxEVL = Builder.CreateNUWMul(VScale, FactorConst, "scalable_size");
506 } else {
508 }
510 return true;
511}
512
513bool CachingVPExpander::foldEVLIntoMask(VPIntrinsic &VPI) {
514 LLVM_DEBUG(dbgs() << "Folding vlen for " << VPI << '\n');
515
517
518
520 return false;
521
522
524 if (!OldMaskParam) {
527 "Unexpected VP intrinsic without mask operand");
529 }
530
532 assert(OldMaskParam && "no mask param to fold the vl param into");
533 assert(OldEVLParam && "no EVL param to fold away");
534
535 LLVM_DEBUG(dbgs() << "OLD evl: " << *OldEVLParam << '\n');
536 LLVM_DEBUG(dbgs() << "OLD mask: " << *OldMaskParam << '\n');
537
538
540 Value *VLMask = convertEVLToMask(Builder, OldEVLParam, ElemCount);
541 Value *NewMaskParam = Builder.CreateAnd(VLMask, OldMaskParam);
545 else
547
548
549 discardEVLParameter(VPI);
551 "transformation did not render the evl param ineffective!");
552
553
554 return true;
555}
556
557bool CachingVPExpander::expandPredication(VPIntrinsic &VPI) {
558 LLVM_DEBUG(dbgs() << "Lowering to unpredicated op: " << VPI << '\n');
559
561
562
564
566 return expandPredicationInBinaryOperator(Builder, VPI);
567
569 return expandPredicationInReduction(Builder, *VPRI);
570
572 return expandPredicationInComparison(Builder, *VPCmp);
573
575 return expandPredicationToCastIntrinsic(Builder, VPI);
576
578 default:
579 break;
580 case Intrinsic::vp_fneg: {
583 return NewNegOp;
584 }
585 case Intrinsic::vp_select:
586 case Intrinsic::vp_merge: {
591 return NewSelectOp;
592 }
593 case Intrinsic::vp_abs:
594 case Intrinsic::vp_smax:
595 case Intrinsic::vp_smin:
596 case Intrinsic::vp_umax:
597 case Intrinsic::vp_umin:
598 case Intrinsic::vp_bswap:
599 case Intrinsic::vp_bitreverse:
600 case Intrinsic::vp_ctpop:
601 case Intrinsic::vp_ctlz:
602 case Intrinsic::vp_cttz:
603 case Intrinsic::vp_sadd_sat:
604 case Intrinsic::vp_uadd_sat:
605 case Intrinsic::vp_ssub_sat:
606 case Intrinsic::vp_usub_sat:
607 case Intrinsic::vp_fshl:
608 case Intrinsic::vp_fshr:
609 return expandPredicationToIntCall(Builder, VPI);
610 case Intrinsic::vp_fabs:
611 case Intrinsic::vp_sqrt:
612 case Intrinsic::vp_maxnum:
613 case Intrinsic::vp_minnum:
614 case Intrinsic::vp_maximum:
615 case Intrinsic::vp_minimum:
616 case Intrinsic::vp_fma:
617 case Intrinsic::vp_fmuladd:
618 return expandPredicationToFPCall(Builder, VPI,
620 case Intrinsic::vp_load:
621 case Intrinsic::vp_store:
622 case Intrinsic::vp_gather:
623 case Intrinsic::vp_scatter:
624 return expandPredicationInMemoryIntrinsic(Builder, VPI);
625 }
626
628 if (expandPredicationToFPCall(Builder, VPI, *CID))
629 return true;
630
631 return false;
632}
633
634
635
636void sanitizeStrategy(VPIntrinsic &VPI, VPLegalization &LegalizeStrat) {
637
639
640
643 return;
644 }
645
646
647
648
649
650
654 }
655}
656
658CachingVPExpander::getVPLegalizationStrategy(const VPIntrinsic &VPI) const {
661
662 return VPStrat;
663 }
664
665
666
669 return VPStrat;
670}
671
673CachingVPExpander::expandVectorPredication(VPIntrinsic &VPI) {
674 auto Strategy = getVPLegalizationStrategy(VPI);
675 sanitizeStrategy(VPI, Strategy);
676
678
679
680 switch (Strategy.EVLParamStrategy) {
682 break;
684 if (discardEVLParameter(VPI))
685 Changed = VPExpansionDetails::IntrinsicUpdated;
686 break;
688 if (foldEVLIntoMask(VPI)) {
689 Changed = VPExpansionDetails::IntrinsicUpdated;
690 ++NumFoldedVL;
691 }
692 break;
693 }
694
695
696 switch (Strategy.OpStrategy) {
698 break;
702 if (expandPredication(VPI)) {
703 ++NumLoweredVPOps;
704 Changed = VPExpansionDetails::IntrinsicReplaced;
705 }
706 break;
707 }
708
710}
711}
712
716 return CachingVPExpander(TTI).expandVectorPredication(VPI);
717}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_LIKELY(EXPR)
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static VPTransform parseOverrideOption(const std::string &TextOpt)
Definition ExpandVectorPredication.cpp:64
static cl::opt< std::string > MaskTransformOverride("expandvp-override-mask-transform", cl::init(""), cl::Hidden, cl::desc("Options: " VPINTERNAL_VPLEGAL_CASES ". If non-empty, Ignore " "TargetTransformInfo and " "always use this transformation for the %mask parameter (Used in " "testing)."))
static cl::opt< std::string > EVLTransformOverride("expandvp-override-evl-transform", cl::init(""), cl::Hidden, cl::desc("Options: " VPINTERNAL_VPLEGAL_CASES ". If non-empty, ignore " "TargetTransformInfo and " "always use this transformation for the %evl parameter (Used in " "testing)."))
static void replaceOperation(Value &NewOp, VPIntrinsic &OldOp)
Transfer all properties from OldOp to NewOp and replace all uses.
Definition ExpandVectorPredication.cpp:112
static bool isAllTrueMask(Value *MaskVal)
Definition ExpandVectorPredication.cpp:83
static void transferDecorations(Value &NewVal, VPIntrinsic &VPI)
Transfer operation properties from OldVPI to NewVal.
Definition ExpandVectorPredication.cpp:98
TargetTransformInfo::VPLegalization VPLegalization
Definition ExpandVectorPredication.cpp:33
TargetTransformInfo::VPLegalization::VPTransform VPTransform
Definition ExpandVectorPredication.cpp:34
static bool anyExpandVPOverridesSet()
Definition ExpandVectorPredication.cpp:71
static bool maySpeculateLanes(VPIntrinsic &VPI)
Definition ExpandVectorPredication.cpp:122
static Constant * getSafeDivisor(Type *DivTy)
Definition ExpandVectorPredication.cpp:92
#define VPINTERNAL_VPLEGAL_CASES
Definition ExpandVectorPredication.cpp:37
loop Loop Strength Reduction
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
This pass exposes codegen information to IR-level passes.
LLVM_ABI bool hasAttribute(Attribute::AttrKind Kind) const
Return true if the attribute exists in this set.
Value * getArgOperand(unsigned i) const
void setArgOperand(unsigned i, Value *v)
@ ICMP_ULT
unsigned less than
This is an important base class in LLVM.
Value * CreateNUWMul(Value *LHS, Value *RHS, const Twine &Name="")
LLVM_ABI CallInst * CreateFAddReduce(Value *Acc, Value *Src)
Create a sequential vector fadd reduction intrinsic of the source vector.
IntegerType * getInt1Ty()
Fetch the type representing a single bit.
LLVM_ABI Value * CreateVectorSplat(unsigned NumElts, Value *V, const Twine &Name="")
Return a vector value that contains.
LLVM_ABI CallInst * CreateMaskedLoad(Type *Ty, Value *Ptr, Align Alignment, Value *Mask, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Load intrinsic.
LLVM_ABI CallInst * CreateConstrainedFPCall(Function *Callee, ArrayRef< Value * > Args, const Twine &Name="", std::optional< RoundingMode > Rounding=std::nullopt, std::optional< fp::ExceptionBehavior > Except=std::nullopt)
LLVM_ABI Value * CreateSelect(Value *C, Value *True, Value *False, const Twine &Name="", Instruction *MDFrom=nullptr)
Value * CreateCast(Instruction::CastOps Op, Value *V, Type *DestTy, const Twine &Name="", MDNode *FPMathTag=nullptr, FMFSource FMFSource={})
Value * CreateVScale(Type *Ty, const Twine &Name="")
Create a call to llvm.vscale.().
LLVM_ABI Value * CreateBinaryIntrinsic(Intrinsic::ID ID, Value *LHS, Value *RHS, FMFSource FMFSource={}, const Twine &Name="")
Create a call to intrinsic ID with 2 operands which is mangled on the first type.
LLVM_ABI CallInst * CreateIntrinsic(Intrinsic::ID ID, ArrayRef< Type * > Types, ArrayRef< Value * > Args, FMFSource FMFSource={}, const Twine &Name="")
Create a call to intrinsic ID with Args, mangled using Types.
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
Value * CreateCmp(CmpInst::Predicate Pred, Value *LHS, Value *RHS, const Twine &Name="", MDNode *FPMathTag=nullptr)
LLVM_ABI CallInst * CreateUnaryIntrinsic(Intrinsic::ID ID, Value *V, FMFSource FMFSource={}, const Twine &Name="")
Create a call to intrinsic ID with 1 operand which is mangled on its type.
LoadInst * CreateLoad(Type *Ty, Value *Ptr, const char *Name)
Provided to resolve 'CreateLoad(Ty, Ptr, "...")' correctly, instead of converting the string to 'bool...
Value * CreateAnd(Value *LHS, Value *RHS, const Twine &Name="")
StoreInst * CreateStore(Value *Val, Value *Ptr, bool isVolatile=false)
LLVM_ABI CallInst * CreateMaskedStore(Value *Val, Value *Ptr, Align Alignment, Value *Mask)
Create a call to Masked Store intrinsic.
CallInst * CreateCall(FunctionType *FTy, Value *Callee, ArrayRef< Value * > Args={}, const Twine &Name="", MDNode *FPMathTag=nullptr)
Value * CreateBinOp(Instruction::BinaryOps Opc, Value *LHS, Value *RHS, const Twine &Name="", MDNode *FPMathTag=nullptr)
LLVM_ABI CallInst * CreateFMulReduce(Value *Acc, Value *Src)
Create a sequential vector fmul reduction intrinsic of the source vector.
Value * CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, const Twine &Name="")
Value * CreateFNeg(Value *V, const Twine &Name="", MDNode *FPMathTag=nullptr)
LLVM_ABI Value * CreateStepVector(Type *DstType, const Twine &Name="")
Creates a vector of type DstType with the linear sequence <0, 1, ...>
LLVM_ABI CallInst * CreateMaskedScatter(Value *Val, Value *Ptrs, Align Alignment, Value *Mask=nullptr)
Create a call to Masked Scatter intrinsic.
LLVM_ABI CallInst * CreateMaskedGather(Type *Ty, Value *Ptrs, Align Alignment, Value *Mask=nullptr, Value *PassThru=nullptr, const Twine &Name="")
Create a call to Masked Gather intrinsic.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
LLVM_ABI const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
LLVM_ABI InstListType::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
LLVM_ABI FastMathFlags getFastMathFlags() const LLVM_READONLY
Convenience function for getting all the fast-math flags, which must be an operator which supports th...
LLVM_ABI const DataLayout & getDataLayout() const
Get the data layout of the module this instruction belongs to.
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
void setAlignment(Align Align)
void setAlignment(Align Align)
A switch()-like statement whose cases are string literals.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
LLVM_ABI VPLegalization getVPLegalizationStrategy(const VPIntrinsic &PI) const
The instances of the Type class are immutable: once they are created, they are never changed.
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
Value * getOperand(unsigned i) const
unsigned getNumOperands() const
static LLVM_ABI bool isVPCast(Intrinsic::ID ID)
LLVM_ABI CmpInst::Predicate getPredicate() const
This is the common base class for vector predication intrinsics.
std::optional< unsigned > getFunctionalIntrinsicID() const
LLVM_ABI bool canIgnoreVectorLengthParam() const
LLVM_ABI void setMaskParam(Value *)
static LLVM_ABI std::optional< unsigned > getFunctionalOpcodeForVP(Intrinsic::ID ID)
LLVM_ABI Value * getVectorLengthParam() const
LLVM_ABI void setVectorLengthParam(Value *)
LLVM_ABI Value * getMemoryDataParam() const
LLVM_ABI Value * getMemoryPointerParam() const
std::optional< unsigned > getConstrainedIntrinsicID() const
LLVM_ABI MaybeAlign getPointerAlignment() const
LLVM_ABI Value * getMaskParam() const
LLVM_ABI ElementCount getStaticVectorLength() const
std::optional< unsigned > getFunctionalOpcode() const
LLVM_ABI unsigned getStartParamPos() const
LLVM_ABI unsigned getVectorParamPos() const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
LLVM_ABI void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
LLVM_ABI LLVMContext & getContext() const
All values hold a context through their type.
LLVM_ABI void takeName(Value *V)
Transfer the name from V to this value.
constexpr ScalarTy getFixedValue() const
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
const ParentTy * getParent() const
self_iterator getIterator()
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
LLVM_ABI Function * getOrInsertDeclaration(Module *M, ID id, ArrayRef< Type * > Tys={})
Look up the Function declaration of the intrinsic id in the Module M.
LLVM_ABI bool isConstrainedFPIntrinsic(ID QID)
Returns true if the intrinsic ID is for one of the "ConstrainedFloating-Point Intrinsics".
LLVM_ABI AttributeSet getFnAttributes(LLVMContext &C, ID id)
Return the function attributes for an intrinsic.
initializer< Ty > init(const Ty &Val)
ElementType
The element type of an SRV or UAV resource.
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
LLVM_ABI Intrinsic::ID getMinMaxReductionIntrinsicOp(Intrinsic::ID RdxID)
Returns the min/max intrinsic used when expanding a min/max reduction.
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
FunctionAddr VTableAddr uintptr_t uintptr_t Int32Ty
LLVM_ABI Value * getReductionIdentity(Intrinsic::ID RdxID, Type *Ty, FastMathFlags FMF)
Given information about an @llvm.vector.reduce.
LLVM_ABI unsigned getArithmeticReductionInstruction(Intrinsic::ID RdxID)
Returns the arithmetic instruction opcode used when expanding a reduction.
LLVM_ABI Value * getSplatValue(const Value *V)
Get splat value if the input is a splat vector or return nullptr.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
VPExpansionDetails expandVectorPredicationIntrinsic(VPIntrinsic &VPI, const TargetTransformInfo &TTI)
Expand a vector predication intrinsic.
Definition ExpandVectorPredication.cpp:714
LLVM_ABI bool isSafeToSpeculativelyExecuteWithOpcode(unsigned Opcode, const Instruction *Inst, const Instruction *CtxI=nullptr, AssumptionCache *AC=nullptr, const DominatorTree *DT=nullptr, const TargetLibraryInfo *TLI=nullptr, bool UseVariableInfo=true, bool IgnoreUBImplyingAttrs=true)
This returns the same result as isSafeToSpeculativelyExecute if Opcode is the actual opcode of Inst.
IRBuilder(LLVMContext &, FolderTy, InserterTy, MDNode *, ArrayRef< OperandBundleDef >) -> IRBuilder< FolderTy, InserterTy >
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
VPExpansionDetails
Represents the details the expansion of a VP intrinsic.
Align valueOrOne() const
For convenience, returns a valid alignment or 1 if undefined.
VPTransform EVLParamStrategy