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 bool VerifyLate;
35
37
38 // Verify that phi-like recipes are at the beginning of \p VPBB, with no
39 // other recipes in between. Also check that only header blocks contain
40 // VPHeaderPHIRecipes.
41 bool verifyPhiRecipes(const VPBasicBlock *VPBB);
42
43 /// Verify that \p EVL is used correctly. The user must be either in
44 /// EVL-based recipes as a last operand or VPInstruction::Add which is
45 /// incoming value into EVL's recipe.
46 bool verifyEVLRecipe(const VPInstruction &EVL) const;
47
48 /// Verify that \p LastActiveLane's operand is guaranteed to be a prefix-mask.
49 bool verifyLastActiveLaneRecipe(const VPInstruction &LastActiveLane) const;
50
51 bool verifyVPBasicBlock(const VPBasicBlock *VPBB);
52
53 bool verifyBlock(const VPBlockBase *VPB);
54
55 /// Helper function that verifies the CFG invariants of the VPBlockBases
56 /// within
57 /// \p Region. Checks in this function are generic for VPBlockBases. They are
58 /// not specific for VPBasicBlocks or VPRegionBlocks.
59 bool verifyBlocksInRegion(const VPRegionBlock *Region);
60
61 /// Verify the CFG invariants of VPRegionBlock \p Region and its nested
62 /// VPBlockBases. Do not recurse inside nested VPRegionBlocks.
63 bool verifyRegion(const VPRegionBlock *Region);
64
65 /// Verify the CFG invariants of VPRegionBlock \p Region and its nested
66 /// VPBlockBases. Recurse inside nested VPRegionBlocks.
67 bool verifyRegionRec(const VPRegionBlock *Region);
68
69public:
70 VPlanVerifier(VPDominatorTree &VPDT, VPTypeAnalysis &TypeInfo,
71 bool VerifyLate)
72 : VPDT(VPDT), TypeInfo(TypeInfo), VerifyLate(VerifyLate) {}
73
74 bool verify(const VPlan &Plan);
75};
76} // namespace
77
78bool VPlanVerifier::verifyPhiRecipes(const VPBasicBlock *VPBB) {
79 auto RecipeI = VPBB->begin();
80 auto End = VPBB->end();
81 unsigned NumActiveLaneMaskPhiRecipes = 0;
82 bool IsHeaderVPBB = VPBlockUtils::isHeader(VPBB, VPDT);
83 while (RecipeI != End && RecipeI->isPhi()) {
85 NumActiveLaneMaskPhiRecipes++;
86
87 if (IsHeaderVPBB &&
89 errs() << "Found non-header PHI recipe in header VPBB";
90#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
91 errs() << ": ";
92 RecipeI->dump();
93#endif
94 return false;
95 }
96
97 if (!IsHeaderVPBB && isa<VPHeaderPHIRecipe>(*RecipeI)) {
98 errs() << "Found header PHI recipe in non-header VPBB";
99#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
100 errs() << ": ";
101 RecipeI->dump();
102#endif
103 return false;
104 }
105
106 // Check if the recipe operands match the number of predecessors.
107 // TODO Extend to other phi-like recipes.
108 if (auto *PhiIRI = dyn_cast<VPIRPhi>(&*RecipeI)) {
109 if (PhiIRI->getNumOperands() != VPBB->getNumPredecessors()) {
110 errs() << "Phi-like recipe with different number of operands and "
111 "predecessors.\n";
112 // TODO: Print broken recipe. At the moment printing an ill-formed
113 // phi-like recipe may crash.
114 return false;
115 }
116 }
117
118 RecipeI++;
119 }
120
121 if (!VerifyLate && NumActiveLaneMaskPhiRecipes > 1) {
122 errs() << "There should be no more than one VPActiveLaneMaskPHIRecipe";
123 return false;
124 }
125
126 while (RecipeI != End) {
127 if (RecipeI->isPhi() && !isa<VPBlendRecipe>(&*RecipeI)) {
128 errs() << "Found phi-like recipe after non-phi recipe";
129
130#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
131 errs() << ": ";
132 RecipeI->dump();
133 errs() << "after\n";
134 std::prev(RecipeI)->dump();
135#endif
136 return false;
137 }
138 RecipeI++;
139 }
140 return true;
141}
142
143bool VPlanVerifier::verifyEVLRecipe(const VPInstruction &EVL) const {
145 errs() << "verifyEVLRecipe should only be called on "
146 "VPInstruction::ExplicitVectorLength\n";
147 return false;
148 }
149 auto VerifyEVLUse = [&](const VPRecipeBase &R,
150 const unsigned ExpectedIdx) -> bool {
152 unsigned UseCount = count(Ops, &EVL);
153 if (UseCount != 1 || Ops[ExpectedIdx] != &EVL) {
154 errs() << "EVL is used as non-last operand in EVL-based recipe\n";
155 return false;
156 }
157 return true;
158 };
159 return all_of(EVL.users(), [this, &VerifyEVLUse](VPUser *U) {
160 return TypeSwitch<const VPUser *, bool>(U)
161 .Case<VPWidenIntrinsicRecipe>([&](const VPWidenIntrinsicRecipe *S) {
162 return VerifyEVLUse(*S, S->getNumOperands() - 1);
163 })
164 .Case<VPWidenStoreEVLRecipe, VPReductionEVLRecipe,
165 VPWidenIntOrFpInductionRecipe, VPWidenPointerInductionRecipe>(
166 [&](const VPRecipeBase *S) { return VerifyEVLUse(*S, 2); })
167 .Case<VPScalarIVStepsRecipe>([&](auto *R) {
168 if (R->getNumOperands() != 3) {
169 errs() << "Unrolling with EVL tail folding not yet supported\n";
170 return false;
171 }
172 return VerifyEVLUse(*R, 2);
173 })
174 .Case<VPWidenLoadEVLRecipe, VPVectorEndPointerRecipe,
175 VPInterleaveEVLRecipe>(
176 [&](const VPRecipeBase *R) { return VerifyEVLUse(*R, 1); })
177 .Case<VPInstructionWithType>(
178 [&](const VPInstructionWithType *S) { return VerifyEVLUse(*S, 0); })
179 .Case<VPInstruction>([&](const VPInstruction *I) {
180 if (I->getOpcode() == Instruction::PHI ||
181 I->getOpcode() == Instruction::ICmp ||
182 I->getOpcode() == Instruction::Sub)
183 return VerifyEVLUse(*I, 1);
184 switch (I->getOpcode()) {
185 case Instruction::Add:
186 break;
187 case Instruction::UIToFP:
188 case Instruction::Trunc:
189 case Instruction::ZExt:
190 case Instruction::Mul:
191 case Instruction::Shl:
192 case Instruction::FMul:
195 // Opcodes above can only use EVL after wide inductions have been
196 // expanded.
197 if (!VerifyLate) {
198 errs() << "EVL used by unexpected VPInstruction\n";
199 return false;
200 }
201 break;
202 default:
203 errs() << "EVL used by unexpected VPInstruction\n";
204 return false;
205 }
206 if (!VerifyLate && !isa<VPEVLBasedIVPHIRecipe>(*I->users().begin())) {
207 errs() << "Result of VPInstruction::Add with EVL operand is "
208 "not used by VPEVLBasedIVPHIRecipe\n";
209 return false;
210 }
211 return true;
212 })
213 .Default([&](const VPUser *U) {
214 errs() << "EVL has unexpected user\n";
215 return false;
216 });
217 });
218}
219
220bool VPlanVerifier::verifyLastActiveLaneRecipe(
221 const VPInstruction &LastActiveLane) const {
222 assert(LastActiveLane.getOpcode() == VPInstruction::LastActiveLane &&
223 "must be called with VPInstruction::LastActiveLane");
224
225 if (LastActiveLane.getNumOperands() < 1) {
226 errs() << "LastActiveLane must have at least one operand\n";
227 return false;
228 }
229
230 const VPlan &Plan = *LastActiveLane.getParent()->getPlan();
231 // All operands must be prefix-mask. Currently we check for header masks or
232 // EVL-derived masks, as those are currently the only operands in practice,
233 // but this may need updating in the future.
234 for (VPValue *Op : LastActiveLane.operands()) {
235 if (vputils::isHeaderMask(Op, Plan))
236 continue;
237
238 // Masks derived from EVL are also fine.
239 auto BroadcastOrEVL =
241 if (match(Op, m_CombineOr(m_ICmp(m_StepVector(), BroadcastOrEVL),
242 m_ICmp(BroadcastOrEVL, m_StepVector()))))
243 continue;
244
245 errs() << "LastActiveLane operand ";
246#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
247 VPSlotTracker Tracker(&Plan);
248 Op->printAsOperand(errs(), Tracker);
249#endif
250 errs() << " must be prefix mask (a header mask or an "
251 "EVL-derived mask currently)\n";
252 return false;
253 }
254
255 return true;
256}
257
258bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
259 if (!verifyPhiRecipes(VPBB))
260 return false;
261
262 // Verify that defs in VPBB dominate all their uses.
263 DenseMap<const VPRecipeBase *, unsigned> RecipeNumbering;
264 unsigned Cnt = 0;
265 for (const VPRecipeBase &R : *VPBB)
266 RecipeNumbering[&R] = Cnt++;
267
268 for (const VPRecipeBase &R : *VPBB) {
269 if (isa<VPIRInstruction>(&R) && !isa<VPIRBasicBlock>(VPBB)) {
270 errs() << "VPIRInstructions ";
271#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
272 R.dump();
273 errs() << " ";
274#endif
275 errs() << "not in a VPIRBasicBlock!\n";
276 return false;
277 }
278 for (const VPValue *V : R.definedValues()) {
279 // Verify that we can infer a scalar type for each defined value. With
280 // assertions enabled, inferScalarType will perform some consistency
281 // checks during type inference.
282 if (!TypeInfo.inferScalarType(V)) {
283 errs() << "Failed to infer scalar type!\n";
284 return false;
285 }
286
287 for (const VPUser *U : V->users()) {
288 auto *UI = cast<VPRecipeBase>(U);
289 if (isa<VPIRPhi>(UI) &&
290 UI->getNumOperands() != UI->getParent()->getNumPredecessors()) {
291 errs() << "Phi-like recipe with different number of operands and "
292 "predecessors.\n";
293 return false;
294 }
295
296 if (auto *Phi = dyn_cast<VPPhiAccessors>(UI)) {
297 for (const auto &[IncomingVPV, IncomingVPBB] :
298 Phi->incoming_values_and_blocks()) {
299 if (IncomingVPV != V)
300 continue;
301
302 if (VPDT.dominates(VPBB, IncomingVPBB))
303 continue;
304
305 errs() << "Incoming def does not dominate incoming block!\n";
306#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
307 VPSlotTracker Tracker(VPBB->getPlan());
308 IncomingVPV->getDefiningRecipe()->print(errs(), " ", Tracker);
309 errs() << "\n does not dominate " << IncomingVPBB->getName()
310 << " for\n";
311 UI->print(errs(), " ", Tracker);
312#endif
313 return false;
314 }
315 continue;
316 }
317 // TODO: Also verify VPPredInstPHIRecipe.
319 continue;
320
321 // If the user is in the same block, check it comes after R in the
322 // block.
323 if (UI->getParent() == VPBB) {
324 if (RecipeNumbering[UI] >= RecipeNumbering[&R])
325 continue;
326 } else {
327 if (VPDT.dominates(VPBB, UI->getParent()))
328 continue;
329 }
330
331 errs() << "Use before def!\n";
332#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
333 VPSlotTracker Tracker(VPBB->getPlan());
334 UI->print(errs(), " ", Tracker);
335 errs() << "\n before\n";
336 R.print(errs(), " ", Tracker);
337 errs() << "\n";
338#endif
339 return false;
340 }
341 }
342 if (const auto *VPI = dyn_cast<VPInstruction>(&R)) {
343 switch (VPI->getOpcode()) {
345 if (!verifyEVLRecipe(*VPI)) {
346 errs() << "EVL VPValue is not used correctly\n";
347 return false;
348 }
349 break;
351 if (!verifyLastActiveLaneRecipe(*VPI))
352 return false;
353 break;
354 default:
355 break;
356 }
357 }
358 }
359
360 auto *IRBB = dyn_cast<VPIRBasicBlock>(VPBB);
361 if (!IRBB)
362 return true;
363
364 if (!WrappedIRBBs.insert(IRBB->getIRBasicBlock()).second) {
365 errs() << "Same IR basic block used by multiple wrapper blocks!\n";
366 return false;
367 }
368
369 return true;
370}
371
372/// Utility function that checks whether \p VPBlockVec has duplicate
373/// VPBlockBases.
374static bool hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
376 for (const auto *Block : VPBlockVec) {
377 if (!VPBlockSet.insert(Block).second)
378 return true;
379 }
380 return false;
381}
382
383bool VPlanVerifier::verifyBlock(const VPBlockBase *VPB) {
384 auto *VPBB = dyn_cast<VPBasicBlock>(VPB);
385 // Check block's condition bit.
386 if (VPBB && !isa<VPIRBasicBlock>(VPB)) {
387 if (VPB->getNumSuccessors() > 1 ||
388 (VPBB->getParent() && VPBB->isExiting() &&
389 !VPBB->getParent()->isReplicator())) {
390 if (!VPBB->getTerminator()) {
391 errs() << "Block has multiple successors but doesn't "
392 "have a proper branch recipe!\n";
393 return false;
394 }
395 } else if (VPBB->getTerminator()) {
396 errs() << "Unexpected branch recipe!\n";
397 return false;
398 }
399 }
400
401 // Check block's successors.
402 const auto &Successors = VPB->getSuccessors();
403 // There must be only one instance of a successor in block's successor list.
404 // TODO: This won't work for switch statements.
405 if (hasDuplicates(Successors)) {
406 errs() << "Multiple instances of the same successor.\n";
407 return false;
408 }
409
410 for (const VPBlockBase *Succ : Successors) {
411 // There must be a bi-directional link between block and successor.
412 const auto &SuccPreds = Succ->getPredecessors();
413 if (!is_contained(SuccPreds, VPB)) {
414 errs() << "Missing predecessor link.\n";
415 return false;
416 }
417 }
418
419 // Check block's predecessors.
420 const auto &Predecessors = VPB->getPredecessors();
421 // There must be only one instance of a predecessor in block's predecessor
422 // list.
423 // TODO: This won't work for switch statements.
424 if (hasDuplicates(Predecessors)) {
425 errs() << "Multiple instances of the same predecessor.\n";
426 return false;
427 }
428
429 for (const VPBlockBase *Pred : Predecessors) {
430 // Block and predecessor must be inside the same region.
431 if (Pred->getParent() != VPB->getParent()) {
432 errs() << "Predecessor is not in the same region.\n";
433 return false;
434 }
435
436 // There must be a bi-directional link between block and predecessor.
437 const auto &PredSuccs = Pred->getSuccessors();
438 if (!is_contained(PredSuccs, VPB)) {
439 errs() << "Missing successor link.\n";
440 return false;
441 }
442 }
443 return !VPBB || verifyVPBasicBlock(VPBB);
444}
445
446bool VPlanVerifier::verifyBlocksInRegion(const VPRegionBlock *Region) {
447 for (const VPBlockBase *VPB : vp_depth_first_shallow(Region->getEntry())) {
448 // Check block's parent.
449 if (VPB->getParent() != Region) {
450 errs() << "VPBlockBase has wrong parent\n";
451 return false;
452 }
453
454 if (!verifyBlock(VPB))
455 return false;
456 }
457 return true;
458}
459
460bool VPlanVerifier::verifyRegion(const VPRegionBlock *Region) {
461 const VPBlockBase *Entry = Region->getEntry();
462 const VPBlockBase *Exiting = Region->getExiting();
463
464 // Entry and Exiting shouldn't have any predecessor/successor, respectively.
465 if (Entry->hasPredecessors()) {
466 errs() << "region entry block has predecessors\n";
467 return false;
468 }
469 if (Exiting->getNumSuccessors() != 0) {
470 errs() << "region exiting block has successors\n";
471 return false;
472 }
473
474 return verifyBlocksInRegion(Region);
475}
476
477bool VPlanVerifier::verifyRegionRec(const VPRegionBlock *Region) {
478 // Recurse inside nested regions and check all blocks inside the region.
479 return verifyRegion(Region) &&
481 [this](const VPBlockBase *VPB) {
482 const auto *SubRegion = dyn_cast<VPRegionBlock>(VPB);
483 return !SubRegion || verifyRegionRec(SubRegion);
484 });
485}
486
487bool VPlanVerifier::verify(const VPlan &Plan) {
489 [this](const VPBlockBase *VPB) { return !verifyBlock(VPB); }))
490 return false;
491
492 const VPRegionBlock *TopRegion = Plan.getVectorLoopRegion();
493 // TODO: Verify all blocks using vp_depth_first_deep iterators.
494 if (!TopRegion)
495 return true;
496
497 if (!verifyRegionRec(TopRegion))
498 return false;
499
500 if (TopRegion->getParent()) {
501 errs() << "VPlan Top Region should have no parent.\n";
502 return false;
503 }
504
505 const VPBasicBlock *Entry = dyn_cast<VPBasicBlock>(TopRegion->getEntry());
506 if (!Entry) {
507 errs() << "VPlan entry block is not a VPBasicBlock\n";
508 return false;
509 }
510
511 if (!isa<VPCanonicalIVPHIRecipe>(&*Entry->begin())) {
512 errs() << "VPlan vector loop header does not start with a "
513 "VPCanonicalIVPHIRecipe\n";
514 return false;
515 }
516
517 const VPBasicBlock *Exiting = dyn_cast<VPBasicBlock>(TopRegion->getExiting());
518 if (!Exiting) {
519 errs() << "VPlan exiting block is not a VPBasicBlock\n";
520 return false;
521 }
522
523 if (Exiting->empty()) {
524 errs() << "VPlan vector loop exiting block must end with BranchOnCount, "
525 "BranchOnCond, or BranchOnTwoConds VPInstruction but is empty\n";
526 return false;
527 }
528
529 auto *LastInst = dyn_cast<VPInstruction>(std::prev(Exiting->end()));
530 if (!match(LastInst, m_CombineOr(m_BranchOnCond(),
532 m_BranchOnTwoConds())))) {
533 errs() << "VPlan vector loop exit must end with BranchOnCount, "
534 "BranchOnCond, or BranchOnTwoConds VPInstruction\n";
535 return false;
536 }
537
538 return true;
539}
540
541bool llvm::verifyVPlanIsValid(const VPlan &Plan, bool VerifyLate) {
542 VPDominatorTree VPDT(const_cast<VPlan &>(Plan));
543 VPTypeAnalysis TypeInfo(Plan);
544 VPlanVerifier Verifier(VPDT, TypeInfo, VerifyLate);
545 return Verifier.verify(Plan);
546}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
@ Default
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
#define I(x, y, z)
Definition MD5.cpp:57
ppc ctr loops verify
verify safepoint Safepoint IR Verifier
This file defines the SmallPtrSet class.
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 hasDuplicates(const SmallVectorImpl< VPBlockBase * > &VPBlockVec)
Utility function that checks whether VPBlockVec has duplicate VPBlockBases.
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:
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
Implements a dense probed hash-table based set with some number of buckets stored inline.
Definition DenseSet.h:291
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.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
Definition VPlan.h:3948
iterator end()
Definition VPlan.h:3985
iterator begin()
Recipe iterator methods.
Definition VPlan.h:3983
bool empty() const
Definition VPlan.h:3994
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
Definition VPlan.h:81
VPRegionBlock * getParent()
Definition VPlan.h:173
size_t getNumSuccessors() const
Definition VPlan.h:219
size_t getNumPredecessors() const
Definition VPlan.h:220
const VPBlocksTy & getPredecessors() const
Definition VPlan.h:204
VPlan * getPlan()
Definition VPlan.cpp:173
const VPBlocksTy & getSuccessors() const
Definition VPlan.h:198
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:1034
unsigned getOpcode() const
Definition VPlan.h:1189
VPBasicBlock * getParent()
Definition VPlan.h:408
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
Definition VPlan.h:4136
const VPBlockBase * getEntry() const
Definition VPlan.h:4172
const VPBlockBase * getExiting() const
Definition VPlan.h:4184
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:297
unsigned getNumOperands() const
Definition VPlanValue.h:267
user_range users()
Definition VPlanValue.h:126
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition VPlan.h:4266
VPBasicBlock * getEntry()
Definition VPlan.h:4355
LLVM_ABI_FOR_TEST VPRegionBlock * getVectorLoopRegion()
Returns the VPRegionBlock of the vector loop.
Definition VPlan.cpp:1022
std::pair< iterator, bool > insert(const ValueT &V)
Definition DenseSet.h:202
@ Entry
Definition COFF.h:862
bool match(Val *V, const Pattern &P)
CmpClass_match< LHS, RHS, ICmpInst > m_ICmp(CmpPredicate &Pred, const LHS &L, const RHS &R)
match_combine_or< LTy, RTy > m_CombineOr(const LTy &L, const RTy &R)
Combine two pattern matchers matching L || R.
VPInstruction_match< VPInstruction::StepVector > m_StepVector()
VPInstruction_match< VPInstruction::BranchOnTwoConds > m_BranchOnTwoConds()
VPInstruction_match< VPInstruction::BranchOnCount > m_BranchOnCount()
VPInstruction_match< VPInstruction::Broadcast, Op0_t > m_Broadcast(const Op0_t &Op0)
class_match< VPValue > m_VPValue()
Match an arbitrary VPValue and ignore it.
VPInstruction_match< VPInstruction::ExplicitVectorLength, Op0_t > m_EVL(const Op0_t &Op0)
VPInstruction_match< VPInstruction::BranchOnCond > m_BranchOnCond()
NodeAddr< PhiNode * > Phi
Definition RDFGraph.h:390
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.
Definition Types.h:26
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:1737
LLVM_ABI_FOR_TEST bool verifyVPlanIsValid(const VPlan &Plan, bool VerifyLate=false)
Verify invariants for general VPlans.
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:1744
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
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.
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
Definition STLExtras.h:2002
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:1945