LLVM 22.0.0git
VPlanUtils.cpp
Go to the documentation of this file.
1//===- VPlanUtils.cpp - VPlan-related utilities ---------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "VPlanUtils.h"
10#include "VPlanCFG.h"
11#include "VPlanDominatorTree.h"
12#include "VPlanPatternMatch.h"
13#include "llvm/ADT/TypeSwitch.h"
15
16using namespace llvm;
17using namespace llvm::VPlanPatternMatch;
18
20 return all_of(Def->users(),
21 [Def](const VPUser *U) { return U->onlyFirstLaneUsed(Def); });
22}
23
25 return all_of(Def->users(),
26 [Def](const VPUser *U) { return U->onlyFirstPartUsed(Def); });
27}
28
30 return all_of(Def->users(),
31 [Def](const VPUser *U) { return U->usesScalars(Def); });
32}
33
35 if (auto *E = dyn_cast<SCEVConstant>(Expr))
36 return Plan.getOrAddLiveIn(E->getValue());
37 // Skip SCEV expansion if Expr is a SCEVUnknown wrapping a non-instruction
38 // value. Otherwise the value may be defined in a loop and using it directly
39 // will break LCSSA form. The SCEV expansion takes care of preserving LCSSA
40 // form.
41 auto *U = dyn_cast<SCEVUnknown>(Expr);
42 if (U && !isa<Instruction>(U->getValue()))
43 return Plan.getOrAddLiveIn(U->getValue());
44 auto *Expanded = new VPExpandSCEVRecipe(Expr);
45 Plan.getEntry()->appendRecipe(Expanded);
46 return Expanded;
47}
48
49bool vputils::isHeaderMask(const VPValue *V, const VPlan &Plan) {
51 return true;
52
53 auto IsWideCanonicalIV = [](VPValue *A) {
57 };
58
59 VPValue *A, *B;
60
62 return B == Plan.getTripCount() &&
63 (match(A,
66 m_One(), m_Specific(&Plan.getVF()))) ||
67 IsWideCanonicalIV(A));
68
69 return match(V, m_ICmp(m_VPValue(A), m_VPValue(B))) && IsWideCanonicalIV(A) &&
70 B == Plan.getBackedgeTakenCount();
71}
72
74 ScalarEvolution &SE, const Loop *L) {
75 if (V->isLiveIn()) {
76 if (Value *LiveIn = V->getLiveInIRValue())
77 return SE.getSCEV(LiveIn);
78 return SE.getCouldNotCompute();
79 }
80
81 // TODO: Support constructing SCEVs for more recipes as needed.
82 return TypeSwitch<const VPRecipeBase *, const SCEV *>(V->getDefiningRecipe())
84 [](const VPExpandSCEVRecipe *R) { return R->getSCEV(); })
85 .Case<VPCanonicalIVPHIRecipe>([&SE, L](const VPCanonicalIVPHIRecipe *R) {
86 if (!L)
87 return SE.getCouldNotCompute();
88 const SCEV *Start = getSCEVExprForVPValue(R->getOperand(0), SE, L);
89 return SE.getAddRecExpr(Start, SE.getOne(Start->getType()), L,
91 })
92 .Case<VPDerivedIVRecipe>([&SE, L](const VPDerivedIVRecipe *R) {
93 const SCEV *Start = getSCEVExprForVPValue(R->getOperand(0), SE, L);
94 const SCEV *IV = getSCEVExprForVPValue(R->getOperand(1), SE, L);
95 const SCEV *Scale = getSCEVExprForVPValue(R->getOperand(2), SE, L);
96 if (any_of(ArrayRef({Start, IV, Scale}), IsaPred<SCEVCouldNotCompute>))
97 return SE.getCouldNotCompute();
98
99 return SE.getAddExpr(SE.getTruncateOrSignExtend(Start, IV->getType()),
101 Scale, IV->getType())));
102 })
103 .Case<VPScalarIVStepsRecipe>([&SE, L](const VPScalarIVStepsRecipe *R) {
104 const SCEV *IV = getSCEVExprForVPValue(R->getOperand(0), SE, L);
105 const SCEV *Step = getSCEVExprForVPValue(R->getOperand(1), SE, L);
107 !Step->isOne())
108 return SE.getCouldNotCompute();
109 return SE.getMulExpr(SE.getTruncateOrSignExtend(IV, Step->getType()),
110 Step);
111 })
112 .Case<VPReplicateRecipe>([&SE, L](const VPReplicateRecipe *R) {
113 if (R->getOpcode() != Instruction::GetElementPtr)
114 return SE.getCouldNotCompute();
115
116 const SCEV *Base = getSCEVExprForVPValue(R->getOperand(0), SE, L);
118 return SE.getCouldNotCompute();
119
120 SmallVector<const SCEV *> IndexExprs;
121 for (VPValue *Index : drop_begin(R->operands())) {
122 const SCEV *IndexExpr = getSCEVExprForVPValue(Index, SE, L);
123 if (isa<SCEVCouldNotCompute>(IndexExpr))
124 return SE.getCouldNotCompute();
125 IndexExprs.push_back(IndexExpr);
126 }
127
128 Type *SrcElementTy = cast<GetElementPtrInst>(R->getUnderlyingInstr())
129 ->getSourceElementType();
130 return SE.getGEPExpr(Base, IndexExprs, SrcElementTy);
131 })
132 .Default([&SE](const VPRecipeBase *) { return SE.getCouldNotCompute(); });
133}
134
136 auto PreservesUniformity = [](unsigned Opcode) -> bool {
137 if (Instruction::isBinaryOp(Opcode) || Instruction::isCast(Opcode))
138 return true;
139 switch (Opcode) {
140 case Instruction::GetElementPtr:
141 case Instruction::ICmp:
142 case Instruction::FCmp:
143 case Instruction::Select:
147 return true;
148 default:
149 return false;
150 }
151 };
152
153 // A live-in must be uniform across the scope of VPlan.
154 if (VPV->isLiveIn())
155 return true;
156
157 if (auto *Rep = dyn_cast<VPReplicateRecipe>(VPV)) {
158 const VPRegionBlock *RegionOfR = Rep->getRegion();
159 // Don't consider recipes in replicate regions as uniform yet; their first
160 // lane cannot be accessed when executing the replicate region for other
161 // lanes.
162 if (RegionOfR && RegionOfR->isReplicator())
163 return false;
164 return Rep->isSingleScalar() || (PreservesUniformity(Rep->getOpcode()) &&
165 all_of(Rep->operands(), isSingleScalar));
166 }
170 if (auto *WidenR = dyn_cast<VPWidenRecipe>(VPV)) {
171 return PreservesUniformity(WidenR->getOpcode()) &&
172 all_of(WidenR->operands(), isSingleScalar);
173 }
174 if (auto *VPI = dyn_cast<VPInstruction>(VPV))
175 return VPI->isSingleScalar() || VPI->isVectorToScalar() ||
176 (PreservesUniformity(VPI->getOpcode()) &&
177 all_of(VPI->operands(), isSingleScalar));
179 return false;
180 if (isa<VPReductionRecipe>(VPV))
181 return true;
182 if (auto *Expr = dyn_cast<VPExpressionRecipe>(VPV))
183 return Expr->isSingleScalar();
184
185 // VPExpandSCEVRecipes must be placed in the entry and are always uniform.
186 return isa<VPExpandSCEVRecipe>(VPV);
187}
188
190 // Live-ins are uniform.
191 if (V->isLiveIn())
192 return true;
193
194 VPRecipeBase *R = V->getDefiningRecipe();
195 if (R && V->isDefinedOutsideLoopRegions()) {
196 if (match(V->getDefiningRecipe(),
198 return false;
199 return all_of(R->operands(), isUniformAcrossVFsAndUFs);
200 }
201
202 auto *CanonicalIV =
203 R->getParent()->getEnclosingLoopRegion()->getCanonicalIV();
204 // Canonical IV chain is uniform.
205 if (V == CanonicalIV || V == CanonicalIV->getBackedgeValue())
206 return true;
207
209 .Case<VPDerivedIVRecipe>([](const auto *R) { return true; })
210 .Case<VPReplicateRecipe>([](const auto *R) {
211 // Be conservative about side-effects, except for the
212 // known-side-effecting assumes and stores, which we know will be
213 // uniform.
214 return R->isSingleScalar() &&
215 (!R->mayHaveSideEffects() ||
216 isa<AssumeInst, StoreInst>(R->getUnderlyingInstr())) &&
217 all_of(R->operands(), isUniformAcrossVFsAndUFs);
218 })
219 .Case<VPInstruction>([](const auto *VPI) {
220 return VPI->isScalarCast() &&
221 isUniformAcrossVFsAndUFs(VPI->getOperand(0));
222 })
223 .Case<VPWidenCastRecipe>([](const auto *R) {
224 // A cast is uniform according to its operand.
225 return isUniformAcrossVFsAndUFs(R->getOperand(0));
226 })
227 .Default([](const VPRecipeBase *) { // A value is considered non-uniform
228 // unless proven otherwise.
229 return false;
230 });
231}
232
234 auto DepthFirst = vp_depth_first_shallow(Plan.getEntry());
235 auto I = find_if(DepthFirst, [&VPDT](VPBlockBase *VPB) {
236 return VPBlockUtils::isHeader(VPB, VPDT);
237 });
238 return I == DepthFirst.end() ? nullptr : cast<VPBasicBlock>(*I);
239}
240
242 if (!R)
243 return 1;
244 if (auto *RR = dyn_cast<VPReductionPHIRecipe>(R))
245 return RR->getVFScaleFactor();
246 if (auto *RR = dyn_cast<VPPartialReductionRecipe>(R))
247 return RR->getVFScaleFactor();
248 if (auto *ER = dyn_cast<VPExpressionRecipe>(R))
249 return ER->getVFScaleFactor();
250 assert(
253 "getting scaling factor of reduction-start-vector not implemented yet");
254 return 1;
255}
256
257std::optional<VPValue *>
261 // Given a VPlan like the following (just including the recipes contributing
262 // to loop control exiting here, not the actual work), we're looking to match
263 // the recipes contributing to the uncountable exit condition comparison
264 // (here, vp<%4>) back to either live-ins or the address nodes for the load
265 // used as part of the uncountable exit comparison so that we can copy them
266 // to a preheader and rotate the address in the loop to the next vector
267 // iteration.
268 //
269 // Currently, the address of the load is restricted to a GEP with 2 operands
270 // and a live-in base address. This constraint may be relaxed later.
271 //
272 // VPlan ' for UF>=1' {
273 // Live-in vp<%0> = VF
274 // Live-in ir<64> = original trip-count
275 //
276 // entry:
277 // Successor(s): preheader, vector.ph
278 //
279 // vector.ph:
280 // Successor(s): vector loop
281 //
282 // <x1> vector loop: {
283 // vector.body:
284 // EMIT vp<%2> = CANONICAL-INDUCTION ir<0>
285 // vp<%3> = SCALAR-STEPS vp<%2>, ir<1>, vp<%0>
286 // CLONE ir<%ee.addr> = getelementptr ir<0>, vp<%3>
287 // WIDEN ir<%ee.load> = load ir<%ee.addr>
288 // WIDEN vp<%4> = icmp eq ir<%ee.load>, ir<0>
289 // EMIT vp<%5> = any-of vp<%4>
290 // EMIT vp<%6> = add vp<%2>, vp<%0>
291 // EMIT vp<%7> = icmp eq vp<%6>, ir<64>
292 // EMIT vp<%8> = or vp<%5>, vp<%7>
293 // EMIT branch-on-cond vp<%8>
294 // No successors
295 // }
296 // Successor(s): middle.block
297 //
298 // middle.block:
299 // Successor(s): preheader
300 //
301 // preheader:
302 // No successors
303 // }
304
305 // Find the uncountable loop exit condition.
306 auto *Region = Plan.getVectorLoopRegion();
307 VPValue *UncountableCondition = nullptr;
308 if (!match(Region->getExitingBasicBlock()->getTerminator(),
310 m_AnyOf(m_VPValue(UncountableCondition)), m_VPValue())))))
311 return std::nullopt;
312
314 Worklist.push_back(UncountableCondition);
315 while (!Worklist.empty()) {
316 VPValue *V = Worklist.pop_back_val();
317
318 // Any value defined outside the loop does not need to be copied.
319 if (V->isDefinedOutsideLoopRegions())
320 continue;
321
322 // FIXME: Remove the single user restriction; it's here because we're
323 // starting with the simplest set of loops we can, and multiple
324 // users means needing to add PHI nodes in the transform.
325 if (V->getNumUsers() > 1)
326 return std::nullopt;
327
328 VPValue *Op1, *Op2;
329 // Walk back through recipes until we find at least one load from memory.
330 if (match(V, m_ICmp(m_VPValue(Op1), m_VPValue(Op2)))) {
331 Worklist.push_back(Op1);
332 Worklist.push_back(Op2);
333 Recipes.push_back(V->getDefiningRecipe());
334 } else if (auto *Load = dyn_cast<VPWidenLoadRecipe>(V)) {
335 // Reject masked loads for the time being; they make the exit condition
336 // more complex.
337 if (Load->isMasked())
338 return std::nullopt;
339
340 VPValue *GEP = Load->getAddr();
342 return std::nullopt;
343
344 Recipes.push_back(Load);
345 Recipes.push_back(GEP->getDefiningRecipe());
346 GEPs.push_back(GEP->getDefiningRecipe());
347 } else
348 return std::nullopt;
349 }
350
351 return UncountableCondition;
352}
353
355 const VPDominatorTree &VPDT) {
356 auto *VPBB = dyn_cast<VPBasicBlock>(VPB);
357 if (!VPBB)
358 return false;
359
360 // If VPBB is in a region R, VPBB is a loop header if R is a loop region with
361 // VPBB as its entry, i.e., free of predecessors.
362 if (auto *R = VPBB->getParent())
363 return !R->isReplicator() && !VPBB->hasPredecessors();
364
365 // A header dominates its second predecessor (the latch), with the other
366 // predecessor being the preheader
367 return VPB->getPredecessors().size() == 2 &&
368 VPDT.dominates(VPB, VPB->getPredecessors()[1]);
369}
370
372 const VPDominatorTree &VPDT) {
373 // A latch has a header as its second successor, with its other successor
374 // leaving the loop. A preheader OTOH has a header as its first (and only)
375 // successor.
376 return VPB->getNumSuccessors() == 2 &&
377 VPBlockUtils::isHeader(VPB->getSuccessors()[1], VPDT);
378}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Hexagon Common GEP
#define I(x, y, z)
Definition MD5.cpp:58
This file implements the TypeSwitch template, which mimics a switch() statement whose cases are type ...
This file implements dominator tree analysis for a single level of a VPlan's H-CFG.
static std::optional< unsigned > getOpcode(ArrayRef< VPValue * > Values)
Returns the opcode of Values or ~0 if they do not all agree.
Definition VPlanSLP.cpp:247
static const uint32_t IV[8]
Definition blake3_impl.h:83
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
bool isCast() const
bool isBinaryOp() const
Represents a single loop in the control flow graph.
Definition LoopInfo.h:40
This class represents an analyzed expression in the program.
LLVM_ABI bool isOne() const
Return true if the expression is a constant one.
LLVM_ABI Type * getType() const
Return the LLVM type of this SCEV expression.
The main scalar evolution driver.
LLVM_ABI const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
const SCEV * getOne(Type *Ty)
Return a SCEV for the constant 1 of a specific type.
LLVM_ABI const SCEV * getAddRecExpr(const SCEV *Start, const SCEV *Step, const Loop *L, SCEV::NoWrapFlags Flags)
Get an add recurrence expression for the specified loop.
LLVM_ABI const SCEV * getCouldNotCompute()
LLVM_ABI const SCEV * getGEPExpr(GEPOperator *GEP, ArrayRef< const SCEV * > IndexExprs)
Returns an expression for a GEP.
LLVM_ABI const SCEV * getMulExpr(SmallVectorImpl< const SCEV * > &Ops, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap, unsigned Depth=0)
Get a canonical multiply expression, or something simpler if possible.
LLVM_ABI const SCEV * getAddExpr(SmallVectorImpl< const SCEV * > &Ops, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap, unsigned Depth=0)
Get a canonical add expression, or something simpler if possible.
LLVM_ABI const SCEV * getTruncateOrSignExtend(const SCEV *V, Type *Ty, unsigned Depth=0)
Return a SCEV corresponding to a conversion of the input value to the specified type.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class implements a switch-like dispatch statement for a value of 'T' using dyn_cast functionalit...
Definition TypeSwitch.h:88
TypeSwitch< T, ResultT > & Case(CallableT &&caseFn)
Add a case on the given type.
Definition TypeSwitch.h:97
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
Definition VPlan.h:3820
void appendRecipe(VPRecipeBase *Recipe)
Augment the existing recipes of a VPBasicBlock with an additional Recipe as the last recipe.
Definition VPlan.h:3895
A recipe for vectorizing a phi-node as a sequence of mask-based select instructions.
Definition VPlan.h:2411
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
Definition VPlan.h:80
size_t getNumSuccessors() const
Definition VPlan.h:218
const VPBlocksTy & getPredecessors() const
Definition VPlan.h:203
const VPBlocksTy & getSuccessors() const
Definition VPlan.h:197
static bool isLatch(const VPBlockBase *VPB, const VPDominatorTree &VPDT)
Returns true if VPB is a loop latch, using isHeader().
static bool isHeader(const VPBlockBase *VPB, const VPDominatorTree &VPDT)
Returns true if VPB is a loop header, based on regions or VPDT in their absence.
Canonical scalar induction phi of the vector loop.
Definition VPlan.h:3476
A recipe for converting the input value IV value to the corresponding value of an IV with different s...
Definition VPlan.h:3641
Template specialization of the standard LLVM dominator tree utility for VPBlockBases.
Recipe to expand a SCEV expression.
Definition VPlan.h:3439
@ ReductionStartVector
Start vector for reductions with 3 operands: the original start value, the identity value for the red...
Definition VPlan.h:1054
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
Definition VPlan.h:386
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
Definition VPlan.h:4008
bool isReplicator() const
An indicator whether this region is to generate multiple replicated instances of output IR correspond...
Definition VPlan.h:4076
VPCanonicalIVPHIRecipe * getCanonicalIV()
Returns the canonical induction recipe of the region.
Definition VPlan.h:4106
VPReplicateRecipe replicates a given instruction producing multiple scalar copies of the original sca...
Definition VPlan.h:2877
A recipe for handling phi nodes of integer and floating-point inductions, producing their scalar valu...
Definition VPlan.h:3710
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
Definition VPlanValue.h:199
operand_range operands()
Definition VPlanValue.h:267
This is the base class of the VPlan Def/Use graph, used for modeling the data flow into,...
Definition VPlanValue.h:48
VPRecipeBase * getDefiningRecipe()
Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe,...
Definition VPlan.cpp:135
bool isLiveIn() const
Returns true if this VPValue is a live-in, i.e. defined outside the VPlan.
Definition VPlanValue.h:171
A recipe for handling GEP instructions.
Definition VPlan.h:1778
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition VPlan.h:4138
VPBasicBlock * getEntry()
Definition VPlan.h:4232
VPValue & getVF()
Returns the VF of the vector loop region.
Definition VPlan.h:4326
VPValue * getTripCount() const
The trip count of the original loop.
Definition VPlan.h:4294
VPValue * getBackedgeTakenCount() const
Definition VPlan.h:4320
LLVM_ABI_FOR_TEST VPRegionBlock * getVectorLoopRegion()
Returns the VPRegionBlock of the vector loop.
Definition VPlan.cpp:1027
VPValue * getOrAddLiveIn(Value *V)
Gets the live-in VPValue for V or adds a new live-in (if none exists yet) for V.
Definition VPlan.h:4386
LLVM Value Representation.
Definition Value.h:75
OneUse_match< SubPat > m_OneUse(const SubPat &SP)
bool match(Val *V, const Pattern &P)
specificval_ty m_Specific(const Value *V)
Match if we have a specific specified value.
cst_pred_ty< is_one > m_One()
Match an integer 1 or a vector with all elements equal to 1.
CmpClass_match< LHS, RHS, ICmpInst > m_ICmp(CmpPredicate &Pred, const LHS &L, const RHS &R)
AllRecipe_commutative_match< Instruction::Or, Op0_t, Op1_t > m_c_BinaryOr(const Op0_t &Op0, const Op1_t &Op1)
VPInstruction_match< VPInstruction::AnyOf, Op0_t > m_AnyOf(const Op0_t &Op0)
VPScalarIVSteps_match< Op0_t, Op1_t, Op2_t > m_ScalarIVSteps(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
GEPLikeRecipe_match< Op0_t, Op1_t > m_GetElementPtr(const Op0_t &Op0, const Op1_t &Op1)
VPInstruction_match< VPInstruction::ActiveLaneMask, Op0_t, Op1_t, Op2_t > m_ActiveLaneMask(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
class_match< VPValue > m_VPValue()
Match an arbitrary VPValue and ignore it.
bind_ty< VPInstruction > m_VPInstruction(VPInstruction *&V)
Match a VPInstruction, capturing if we match.
VPInstruction_match< VPInstruction::BranchOnCond > m_BranchOnCond()
bool isSingleScalar(const VPValue *VPV)
Returns true if VPV is a single scalar, either because it produces the same value for all lanes or on...
bool isUniformAcrossVFsAndUFs(VPValue *V)
Checks if V is uniform across all VF lanes and UF parts.
VPValue * getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr)
Get or create a VPValue that corresponds to the expansion of Expr.
VPBasicBlock * getFirstLoopHeader(VPlan &Plan, VPDominatorTree &VPDT)
Returns the header block of the first, top-level loop, or null if none exist.
bool onlyFirstPartUsed(const VPValue *Def)
Returns true if only the first part of Def is used.
bool onlyFirstLaneUsed(const VPValue *Def)
Returns true if only the first lane of Def is used.
bool onlyScalarValuesUsed(const VPValue *Def)
Returns true if only scalar values of Def are used by all users.
unsigned getVFScaleFactor(VPRecipeBase *R)
Get the VF scaling factor applied to the recipe's output, if the recipe has one.
bool isHeaderMask(const VPValue *V, const VPlan &Plan)
Return true if V is a header mask in Plan.
std::optional< VPValue * > getRecipesForUncountableExit(VPlan &Plan, SmallVectorImpl< VPRecipeBase * > &Recipes, SmallVectorImpl< VPRecipeBase * > &GEPs)
Returns the VPValue representing the uncountable exit comparison used by AnyOf if the recipes it depe...
const SCEV * getSCEVExprForVPValue(const VPValue *V, ScalarEvolution &SE, const Loop *L=nullptr)
Return the SCEV expression for V.
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
Definition STLExtras.h:316
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1725
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
iterator_range< df_iterator< VPBlockShallowTraversalWrapper< VPBlockBase * > > > vp_depth_first_shallow(VPBlockBase *G)
Returns an iterator range to traverse the graph starting at G in depth-first order.
Definition VPlanCFG.h:216
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1732
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1758
@ Default
The result values are uniform if and only if all operands are uniform.
Definition Uniformity.h:20
constexpr detail::IsaCheckPredicate< Types... > IsaPred
Function object wrapper for the llvm::isa type check.
Definition Casting.h:830
A recipe for widening select instructions.
Definition VPlan.h:1732