LLVM 23.0.0git
VPlanVerifier.cpp
Go to the documentation of this file.
1//===-- VPlanVerifier.cpp -------------------------------------------------===//
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/// \file
10/// This file defines the class VPlanVerifier, which contains utility functions
11/// to check the consistency and invariants of a VPlan.
12///
13//===----------------------------------------------------------------------===//
14
15#include "VPlanVerifier.h"
16#include "VPlan.h"
17#include "VPlanCFG.h"
18#include "VPlanDominatorTree.h"
19#include "VPlanHelpers.h"
20#include "VPlanPatternMatch.h"
21#include "VPlanUtils.h"
23#include "llvm/ADT/TypeSwitch.h"
24
25#define DEBUG_TYPE "loop-vectorize"
26
27using namespace llvm;
28using namespace VPlanPatternMatch;
29
30namespace {
31class VPlanVerifier {
32 const VPDominatorTree &VPDT;
33 VPTypeAnalysis &TypeInfo;
34
36
37 // Verify that phi-like recipes are at the beginning of \p VPBB, with no
38 // other recipes in between. Also check that only header blocks contain
39 // VPHeaderPHIRecipes.
40 bool verifyPhiRecipes(const VPBasicBlock *VPBB);
41
42 /// Verify that \p LastActiveLane's operand is guaranteed to be a prefix-mask.
43 bool verifyLastActiveLaneRecipe(const VPInstruction &LastActiveLane) const;
44
45 bool verifyVPBasicBlock(const VPBasicBlock *VPBB);
46
47 bool verifyBlock(const VPBlockBase *VPB);
48
49 /// Helper function that verifies the CFG invariants of the VPBlockBases
50 /// within
51 /// \p Region. Checks in this function are generic for VPBlockBases. They are
52 /// not specific for VPBasicBlocks or VPRegionBlocks.
53 bool verifyBlocksInRegion(const VPRegionBlock *Region);
54
55 /// Verify the CFG invariants of VPRegionBlock \p Region and its nested
56 /// VPBlockBases. Do not recurse inside nested VPRegionBlocks.
57 bool verifyRegion(const VPRegionBlock *Region);
58
59 /// Verify the CFG invariants of VPRegionBlock \p Region and its nested
60 /// VPBlockBases. Recurse inside nested VPRegionBlocks.
61 bool verifyRegionRec(const VPRegionBlock *Region);
62
63public:
64 VPlanVerifier(VPDominatorTree &VPDT, VPTypeAnalysis &TypeInfo)
65 : VPDT(VPDT), TypeInfo(TypeInfo) {}
66
67 bool verify(const VPlan &Plan);
68};
69} // namespace
70
71bool VPlanVerifier::verifyPhiRecipes(const VPBasicBlock *VPBB) {
72 auto RecipeI = VPBB->begin();
73 auto End = VPBB->end();
74 unsigned NumActiveLaneMaskPhiRecipes = 0;
75 bool IsHeaderVPBB = VPBlockUtils::isHeader(VPBB, VPDT);
76 while (RecipeI != End && RecipeI->isPhi()) {
78 NumActiveLaneMaskPhiRecipes++;
79
80 if (IsHeaderVPBB &&
82 errs() << "Found non-header PHI recipe in header VPBB";
83#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
84 errs() << ": ";
85 RecipeI->dump();
86#endif
87 return false;
88 }
89
90 if (!IsHeaderVPBB && isa<VPHeaderPHIRecipe>(*RecipeI)) {
91 errs() << "Found header PHI recipe in non-header VPBB";
92#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
93 errs() << ": ";
94 RecipeI->dump();
95#endif
96 return false;
97 }
98
100 RecipeI->getIterator() != VPBB->begin()) {
101 errs() << "CurrentIteration PHI is not the first recipe\n";
102 return false;
103 }
104
105 // Check if the recipe operands match the number of predecessors.
106 // TODO Extend to other phi-like recipes.
107 if (auto *PhiIRI = dyn_cast<VPIRPhi>(&*RecipeI)) {
108 if (PhiIRI->getNumOperands() != VPBB->getNumPredecessors()) {
109 errs() << "Phi-like recipe with different number of operands and "
110 "predecessors.\n";
111 // TODO: Print broken recipe. At the moment printing an ill-formed
112 // phi-like recipe may crash.
113 return false;
114 }
115 }
116
117 RecipeI++;
118 }
119
120 if (!VPBB->getPlan()->isUnrolled() && NumActiveLaneMaskPhiRecipes > 1) {
121 errs() << "There should be no more than one VPActiveLaneMaskPHIRecipe";
122 return false;
123 }
124
125 while (RecipeI != End) {
126 if (RecipeI->isPhi() && !isa<VPBlendRecipe>(&*RecipeI)) {
127 errs() << "Found phi-like recipe after non-phi recipe";
128
129#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
130 errs() << ": ";
131 RecipeI->dump();
132 errs() << "after\n";
133 std::prev(RecipeI)->dump();
134#endif
135 return false;
136 }
137 RecipeI++;
138 }
139 return true;
140}
141
142static bool isKnownMonotonic(VPValue *V) {
143 VPValue *X, *Y;
144 if (match(V, m_Add(m_VPValue(X), m_VPValue(Y))))
145 return cast<VPRecipeWithIRFlags>(V)->hasNoUnsignedWrap() &&
147 if (match(V, m_StepVector()))
148 return true;
149 // Only handle a subset of IVs until we can guarantee there's no overflow.
150 if (auto *WidenIV = dyn_cast<VPWidenIntOrFpInductionRecipe>(V))
151 return WidenIV->isCanonical();
152 if (auto *Steps = dyn_cast<VPScalarIVStepsRecipe>(V))
153 return match(Steps->getOperand(0),
157 match(Steps->getStepValue(), m_One());
159 return true;
161}
162
163bool VPlanVerifier::verifyLastActiveLaneRecipe(
164 const VPInstruction &LastActiveLane) const {
165 assert(LastActiveLane.getOpcode() == VPInstruction::LastActiveLane &&
166 "must be called with VPInstruction::LastActiveLane");
167
168 if (LastActiveLane.getNumOperands() < 1) {
169 errs() << "LastActiveLane must have at least one operand\n";
170 return false;
171 }
172
173 const VPlan &Plan = *LastActiveLane.getParent()->getPlan();
174 // All operands must be prefix-mask. This means an icmp ult/ule LHS, RHS where
175 // the LHS is monotonically increasing and RHS is uniform across VFs and UF.
176 for (VPValue *Op : LastActiveLane.operands()) {
177 if (vputils::isHeaderMask(Op, Plan))
178 continue;
179
180 CmpPredicate Pred;
181 VPValue *LHS, *RHS;
182 if (match(Op, m_ICmp(Pred, m_VPValue(LHS), m_VPValue(RHS))) &&
183 (Pred == CmpInst::ICMP_ULE || Pred == CmpInst::ICMP_ULT) &&
186 match(RHS, m_EVL(m_VPValue()))))
187 continue;
188
189 errs() << "LastActiveLane operand ";
190#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
191 VPSlotTracker Tracker(&Plan);
192 Op->printAsOperand(errs(), Tracker);
193#endif
194 errs() << " must be prefix mask (a header mask or an "
195 "EVL-derived mask currently)\n";
196 return false;
197 }
198
199 return true;
200}
201
202bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
203 if (!verifyPhiRecipes(VPBB))
204 return false;
205
206 // Verify that defs in VPBB dominate all their uses.
207 DenseMap<const VPRecipeBase *, unsigned> RecipeNumbering;
208 unsigned Cnt = 0;
209 for (const VPRecipeBase &R : *VPBB)
210 RecipeNumbering[&R] = Cnt++;
211
212 for (const VPRecipeBase &R : *VPBB) {
213 if (isa<VPIRInstruction>(&R) && !isa<VPIRBasicBlock>(VPBB)) {
214 errs() << "VPIRInstructions ";
215#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
216 R.dump();
217 errs() << " ";
218#endif
219 errs() << "not in a VPIRBasicBlock!\n";
220 return false;
221 }
222 for (const VPValue *V : R.definedValues()) {
223 // Verify that we can infer a scalar type for each defined value. With
224 // assertions enabled, inferScalarType will perform some consistency
225 // checks during type inference.
226 if (!TypeInfo.inferScalarType(V)) {
227 errs() << "Failed to infer scalar type!\n";
228 return false;
229 }
230
231 // MaskedCond may be used from blocks it don't dominate; the block will be
232 // linearized and it will dominate its users after linearization.
234 continue;
235
236 for (const VPUser *U : V->users()) {
237 auto *UI = cast<VPRecipeBase>(U);
238 if (isa<VPIRPhi>(UI) &&
239 UI->getNumOperands() != UI->getParent()->getNumPredecessors()) {
240 errs() << "Phi-like recipe with different number of operands and "
241 "predecessors.\n";
242 return false;
243 }
244
245 if (auto *Phi = dyn_cast<VPPhiAccessors>(UI)) {
246 for (const auto &[IncomingVPV, IncomingVPBB] :
247 Phi->incoming_values_and_blocks()) {
248 if (IncomingVPV != V)
249 continue;
250
251 if (VPDT.dominates(VPBB, IncomingVPBB))
252 continue;
253
254 errs() << "Incoming def does not dominate incoming block!\n";
255#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
256 VPSlotTracker Tracker(VPBB->getPlan());
257 IncomingVPV->getDefiningRecipe()->print(errs(), " ", Tracker);
258 errs() << "\n does not dominate " << IncomingVPBB->getName()
259 << " for\n";
260 UI->print(errs(), " ", Tracker);
261#endif
262 return false;
263 }
264 continue;
265 }
266 // TODO: Also verify VPPredInstPHIRecipe.
268 continue;
269
270 // If the user is in the same block, check it comes after R in the
271 // block.
272 if (UI->getParent() == VPBB) {
273 if (RecipeNumbering[UI] >= RecipeNumbering[&R])
274 continue;
275 } else {
276 if (VPDT.dominates(VPBB, UI->getParent()))
277 continue;
278 }
279
280 // Recipes in blocks with a MaskedCond may be used in exit blocks; the
281 // block will be linearized and its recipes will dominate their users
282 // after linearization.
283 bool BlockHasMaskedCond = any_of(*VPBB, [](const VPRecipeBase &R) {
285 });
286 if (BlockHasMaskedCond &&
287 any_of(VPBB->getPlan()->getExitBlocks(), [UI](VPIRBasicBlock *EB) {
288 return is_contained(EB->getPredecessors(), UI->getParent());
289 })) {
290 continue;
291 }
292
293 errs() << "Use before def!\n";
294#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
295 VPSlotTracker Tracker(VPBB->getPlan());
296 UI->print(errs(), " ", Tracker);
297 errs() << "\n before\n";
298 R.print(errs(), " ", Tracker);
299 errs() << "\n";
300#endif
301 return false;
302 }
303 }
304 if (const auto *VPI = dyn_cast<VPInstruction>(&R)) {
305 switch (VPI->getOpcode()) {
307 if (!verifyLastActiveLaneRecipe(*VPI))
308 return false;
309 break;
310 default:
311 break;
312 }
313 }
314 if (const auto *ScalarIVSteps = dyn_cast<VPScalarIVStepsRecipe>(&R)) {
315 unsigned NumOps = ScalarIVSteps->getNumOperands();
316 if (NumOps != 3 && NumOps != 4) {
317 errs() << "VPScalarIVStepsRecipe must have 3 or 4 operands\n";
318 return false;
319 }
320 }
321 }
322
323 auto *IRBB = dyn_cast<VPIRBasicBlock>(VPBB);
324 if (!IRBB)
325 return true;
326
327 if (!WrappedIRBBs.insert(IRBB->getIRBasicBlock()).second) {
328 errs() << "Same IR basic block used by multiple wrapper blocks!\n";
329 return false;
330 }
331
332 return true;
333}
334
335bool VPlanVerifier::verifyBlock(const VPBlockBase *VPB) {
336 auto *VPBB = dyn_cast<VPBasicBlock>(VPB);
337 // Check block's condition bit.
338 if (VPBB && !isa<VPIRBasicBlock>(VPB)) {
339 // For plain CFG VPlans, verify header and latch block structure.
340 if (!VPBB->getParent()) {
341 if (VPBlockUtils::isHeader(VPBB, VPDT)) {
342 if (VPB->getNumPredecessors() != 2) {
343 errs()
344 << "Header block in plain CFG VPlan must have 2 predecessors!\n";
345 return false;
346 }
347 // Predecessor 0 is preheader, predecessor 1 is latch.
348 if (!VPBlockUtils::isLatch(VPB->getPredecessors()[1], VPDT)) {
349 errs() << "Header's second predecessor must be the latch!\n";
350 return false;
351 }
352 }
353
354 if (VPBlockUtils::isLatch(VPBB, VPDT)) {
355 auto BranchTerminator =
358 if (!match(VPBB->getTerminator(), BranchTerminator)) {
359 errs() << "Latch block must have a branch terminator!\n";
360 return false;
361 }
362 // Successor 0 is middle block, successor 1 is header.
363 if (VPBlockUtils::isHeader(VPB->getSuccessors()[0], VPDT)) {
364 errs() << "Latch's first successor must not be the header (must be "
365 "middle block)!\n";
366 return false;
367 }
368 }
369 } else if (VPB->getNumSuccessors() > 1 ||
370 (VPBB->isExiting() && !VPBB->getParent()->isReplicator())) {
371 if (!VPBB->getTerminator()) {
372 errs() << "Block has multiple successors but doesn't "
373 "have a proper branch recipe!\n";
374 return false;
375 }
376 } else if (VPBB->getTerminator()) {
377 errs() << "Unexpected branch recipe!\n";
378 return false;
379 }
380 }
381
382 // Check block's successors.
383 const auto &Successors = VPB->getSuccessors();
384 for (const VPBlockBase *Succ : Successors) {
385 // There must be a bi-directional link between block and successor.
386 const auto &SuccPreds = Succ->getPredecessors();
387 if (!is_contained(SuccPreds, VPB)) {
388 errs() << "Missing predecessor link.\n";
389 return false;
390 }
391 }
392
393 // Check block's predecessors.
394 const auto &Predecessors = VPB->getPredecessors();
395
396 for (const VPBlockBase *Pred : Predecessors) {
397 // Block and predecessor must be inside the same region.
398 if (Pred->getParent() != VPB->getParent()) {
399 errs() << "Predecessor is not in the same region.\n";
400 return false;
401 }
402
403 // There must be a bi-directional link between block and predecessor.
404 const auto &PredSuccs = Pred->getSuccessors();
405 if (!is_contained(PredSuccs, VPB)) {
406 errs() << "Missing successor link.\n";
407 return false;
408 }
409 }
410 return !VPBB || verifyVPBasicBlock(VPBB);
411}
412
413bool VPlanVerifier::verifyBlocksInRegion(const VPRegionBlock *Region) {
414 for (const VPBlockBase *VPB : vp_depth_first_shallow(Region->getEntry())) {
415 // Check block's parent.
416 if (VPB->getParent() != Region) {
417 errs() << "VPBlockBase has wrong parent\n";
418 return false;
419 }
420
421 if (!verifyBlock(VPB))
422 return false;
423 }
424 return true;
425}
426
427bool VPlanVerifier::verifyRegion(const VPRegionBlock *Region) {
428 const VPBlockBase *Entry = Region->getEntry();
429 const VPBlockBase *Exiting = Region->getExiting();
430
431 // Entry and Exiting shouldn't have any predecessor/successor, respectively.
432 if (Entry->hasPredecessors()) {
433 errs() << "region entry block has predecessors\n";
434 return false;
435 }
436 if (Exiting->getNumSuccessors() != 0) {
437 errs() << "region exiting block has successors\n";
438 return false;
439 }
440
441 return verifyBlocksInRegion(Region);
442}
443
444bool VPlanVerifier::verifyRegionRec(const VPRegionBlock *Region) {
445 // Recurse inside nested regions and check all blocks inside the region.
446 return verifyRegion(Region) &&
448 [this](const VPBlockBase *VPB) {
449 const auto *SubRegion = dyn_cast<VPRegionBlock>(VPB);
450 return !SubRegion || verifyRegionRec(SubRegion);
451 });
452}
453
454bool VPlanVerifier::verify(const VPlan &Plan) {
456 [this](const VPBlockBase *VPB) { return !verifyBlock(VPB); }))
457 return false;
458
459 const VPRegionBlock *TopRegion = Plan.getVectorLoopRegion();
460 // TODO: Verify all blocks using vp_depth_first_deep iterators.
461 if (!TopRegion)
462 return true;
463
464 if (!verifyRegionRec(TopRegion))
465 return false;
466
467 if (TopRegion->getParent()) {
468 errs() << "VPlan Top Region should have no parent.\n";
469 return false;
470 }
471
472 const VPBasicBlock *Entry = dyn_cast<VPBasicBlock>(TopRegion->getEntry());
473 if (!Entry) {
474 errs() << "VPlan entry block is not a VPBasicBlock\n";
475 return false;
476 }
477
478 const VPBasicBlock *Exiting = dyn_cast<VPBasicBlock>(TopRegion->getExiting());
479 if (!Exiting) {
480 errs() << "VPlan exiting block is not a VPBasicBlock\n";
481 return false;
482 }
483
484 if (Exiting->empty()) {
485 errs() << "VPlan vector loop exiting block must end with BranchOnCount, "
486 "BranchOnCond, or BranchOnTwoConds VPInstruction but is empty\n";
487 return false;
488 }
489
490 auto *LastInst = dyn_cast<VPInstruction>(std::prev(Exiting->end()));
491 if (!match(LastInst, m_CombineOr(m_BranchOnCond(),
493 m_BranchOnTwoConds())))) {
494 errs() << "VPlan vector loop exit must end with BranchOnCount, "
495 "BranchOnCond, or BranchOnTwoConds VPInstruction\n";
496 return false;
497 }
498
499 return true;
500}
501
503 VPDominatorTree VPDT(const_cast<VPlan &>(Plan));
504 VPTypeAnalysis TypeInfo(Plan);
505 VPlanVerifier Verifier(VPDT, TypeInfo);
506 return Verifier.verify(Plan);
507}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define X(NUM, ENUM, NAME)
Definition ELF.h:851
const size_t AbstractManglingParser< Derived, Alloc >::NumOps
ppc ctr loops verify
verify safepoint Safepoint IR Verifier
This file defines the SmallPtrSet class.
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
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.
This file contains the declarations of different VPlan-related auxiliary helpers.
static bool isKnownMonotonic(VPValue *V)
This file declares the class VPlanVerifier, which contains utility functions to check the consistency...
This file contains the declarations of the Vectorization Plan base classes:
Value * RHS
Value * LHS
@ ICMP_ULT
unsigned less than
Definition InstrTypes.h:701
@ ICMP_ULE
unsigned less or equal
Definition InstrTypes.h:702
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
Definition VPlan.h:4168
iterator end()
Definition VPlan.h:4205
iterator begin()
Recipe iterator methods.
Definition VPlan.h:4203
bool empty() const
Definition VPlan.h:4214
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
Definition VPlan.h:98
VPRegionBlock * getParent()
Definition VPlan.h:190
size_t getNumSuccessors() const
Definition VPlan.h:241
size_t getNumPredecessors() const
Definition VPlan.h:242
const VPBlocksTy & getPredecessors() const
Definition VPlan.h:226
VPlan * getPlan()
Definition VPlan.cpp:177
const VPBlocksTy & getSuccessors() const
Definition VPlan.h:215
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.
Template specialization of the standard LLVM dominator tree utility for VPBlockBases.
This is a concrete Recipe that models a single VPlan-level instruction.
Definition VPlan.h:1223
unsigned getOpcode() const
Definition VPlan.h:1402
VPBasicBlock * getParent()
Definition VPlan.h:480
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
Definition VPlan.h:4378
const VPBlockBase * getEntry() const
Definition VPlan.h:4422
const VPBlockBase * getExiting() const
Definition VPlan.h:4434
An analysis for type-inference for VPValues.
Type * inferScalarType(const VPValue *V)
Infer the type of V. Returns the scalar type of V.
operand_range operands()
Definition VPlanValue.h:397
unsigned getNumOperands() const
Definition VPlanValue.h:367
This is the base class of the VPlan Def/Use graph, used for modeling the data flow into,...
Definition VPlanValue.h:49
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition VPlan.h:4526
VPBasicBlock * getEntry()
Definition VPlan.h:4618
bool isUnrolled() const
Returns true if the VPlan already has been unrolled, i.e.
Definition VPlan.h:4781
LLVM_ABI_FOR_TEST VPRegionBlock * getVectorLoopRegion()
Returns the VPRegionBlock of the vector loop.
Definition VPlan.cpp:1095
@ Entry
Definition COFF.h:862
SpecificConstantMatch m_ZeroInt()
Convenience matchers for specific integer values.
match_combine_or< Ty... > m_CombineOr(const Ty &...Ps)
Combine pattern matchers matching any of Ps patterns.
BinaryOp_match< LHS, RHS, Instruction::Add > m_Add(const LHS &L, const RHS &R)
bool match(Val *V, const Pattern &P)
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)
VPInstruction_match< VPInstruction::StepVector > m_StepVector()
VPInstruction_match< VPInstruction::BranchOnTwoConds > m_BranchOnTwoConds()
VPInstruction_match< VPInstruction::BranchOnCount > m_BranchOnCount()
auto m_VPValue()
Match an arbitrary VPValue and ignore it.
VPInstruction_match< VPInstruction::ExplicitVectorLength, Op0_t > m_EVL(const Op0_t &Op0)
match_bind< VPInstruction > m_VPInstruction(VPInstruction *&V)
Match a VPInstruction, capturing if we match.
auto m_DerivedIV(const Op0_t &Op0, const Op1_t &Op1, const Op2_t &Op2)
VPInstruction_match< VPInstruction::BranchOnCond > m_BranchOnCond()
NodeAddr< PhiNode * > Phi
Definition RDFGraph.h:390
bool isUniformAcrossVFsAndUFs(VPValue *V)
Checks if V is uniform across all VF lanes and UF parts.
bool isHeaderMask(const VPValue *V, const VPlan &Plan)
Return true if V is a header mask in Plan.
This is an optimization pass for GlobalISel generic memory operations.
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:1739
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:253
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:1746
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
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
DWARFExpression::Operation Op
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1947
LLVM_ABI_FOR_TEST bool verifyVPlanIsValid(const VPlan &Plan)
Verify invariants for general VPlans.