LLVM 19.0.0git
VPlanHCFGBuilder.cpp
Go to the documentation of this file.
1//===-- VPlanHCFGBuilder.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 implements the construction of a VPlan-based Hierarchical CFG
11/// (H-CFG) for an incoming IR. This construction comprises the following
12/// components and steps:
13//
14/// 1. PlainCFGBuilder class: builds a plain VPBasicBlock-based CFG that
15/// faithfully represents the CFG in the incoming IR. A VPRegionBlock (Top
16/// Region) is created to enclose and serve as parent of all the VPBasicBlocks
17/// in the plain CFG.
18/// NOTE: At this point, there is a direct correspondence between all the
19/// VPBasicBlocks created for the initial plain CFG and the incoming
20/// BasicBlocks. However, this might change in the future.
21///
22//===----------------------------------------------------------------------===//
23
24#include "VPlanHCFGBuilder.h"
27
28#define DEBUG_TYPE "loop-vectorize"
29
30using namespace llvm;
31
32namespace {
33// Class that is used to build the plain CFG for the incoming IR.
34class PlainCFGBuilder {
35private:
36 // The outermost loop of the input loop nest considered for vectorization.
37 Loop *TheLoop;
38
39 // Loop Info analysis.
40 LoopInfo *LI;
41
42 // Vectorization plan that we are working on.
43 VPlan &Plan;
44
45 // Builder of the VPlan instruction-level representation.
46 VPBuilder VPIRBuilder;
47
48 // NOTE: The following maps are intentionally destroyed after the plain CFG
49 // construction because subsequent VPlan-to-VPlan transformation may
50 // invalidate them.
51 // Map incoming BasicBlocks to their newly-created VPBasicBlocks.
53 // Map incoming Value definitions to their newly-created VPValues.
54 DenseMap<Value *, VPValue *> IRDef2VPValue;
55
56 // Hold phi node's that need to be fixed once the plain CFG has been built.
58
59 /// Maps loops in the original IR to their corresponding region.
61
62 // Utility functions.
63 void setVPBBPredsFromBB(VPBasicBlock *VPBB, BasicBlock *BB);
64 void setRegionPredsFromBB(VPRegionBlock *VPBB, BasicBlock *BB);
65 void fixPhiNodes();
66 VPBasicBlock *getOrCreateVPBB(BasicBlock *BB);
67#ifndef NDEBUG
68 bool isExternalDef(Value *Val);
69#endif
70 VPValue *getOrCreateVPOperand(Value *IRVal);
71 void createVPInstructionsForVPBB(VPBasicBlock *VPBB, BasicBlock *BB);
72
73public:
74 PlainCFGBuilder(Loop *Lp, LoopInfo *LI, VPlan &P)
75 : TheLoop(Lp), LI(LI), Plan(P) {}
76
77 /// Build plain CFG for TheLoop and connects it to Plan's entry.
78 void buildPlainCFG();
79};
80} // anonymous namespace
81
82// Set predecessors of \p VPBB in the same order as they are in \p BB. \p VPBB
83// must have no predecessors.
84void PlainCFGBuilder::setVPBBPredsFromBB(VPBasicBlock *VPBB, BasicBlock *BB) {
85 auto GetLatchOfExit = [this](BasicBlock *BB) -> BasicBlock * {
86 auto *SinglePred = BB->getSinglePredecessor();
87 Loop *LoopForBB = LI->getLoopFor(BB);
88 if (!SinglePred || LI->getLoopFor(SinglePred) == LoopForBB)
89 return nullptr;
90 // The input IR must be in loop-simplify form, ensuring a single predecessor
91 // for exit blocks.
92 assert(SinglePred == LI->getLoopFor(SinglePred)->getLoopLatch() &&
93 "SinglePred must be the only loop latch");
94 return SinglePred;
95 };
96 if (auto *LatchBB = GetLatchOfExit(BB)) {
97 auto *PredRegion = getOrCreateVPBB(LatchBB)->getParent();
98 assert(VPBB == cast<VPBasicBlock>(PredRegion->getSingleSuccessor()) &&
99 "successor must already be set for PredRegion; it must have VPBB "
100 "as single successor");
101 VPBB->setPredecessors({PredRegion});
102 return;
103 }
104 // Collect VPBB predecessors.
106 for (BasicBlock *Pred : predecessors(BB))
107 VPBBPreds.push_back(getOrCreateVPBB(Pred));
108 VPBB->setPredecessors(VPBBPreds);
109}
110
111static bool isHeaderBB(BasicBlock *BB, Loop *L) {
112 return L && BB == L->getHeader();
113}
114
115void PlainCFGBuilder::setRegionPredsFromBB(VPRegionBlock *Region,
116 BasicBlock *BB) {
117 // BB is a loop header block. Connect the region to the loop preheader.
118 Loop *LoopOfBB = LI->getLoopFor(BB);
119 Region->setPredecessors({getOrCreateVPBB(LoopOfBB->getLoopPredecessor())});
120}
121
122// Add operands to VPInstructions representing phi nodes from the input IR.
123void PlainCFGBuilder::fixPhiNodes() {
124 for (auto *Phi : PhisToFix) {
125 assert(IRDef2VPValue.count(Phi) && "Missing VPInstruction for PHINode.");
126 VPValue *VPVal = IRDef2VPValue[Phi];
127 assert(isa<VPWidenPHIRecipe>(VPVal) &&
128 "Expected WidenPHIRecipe for phi node.");
129 auto *VPPhi = cast<VPWidenPHIRecipe>(VPVal);
130 assert(VPPhi->getNumOperands() == 0 &&
131 "Expected VPInstruction with no operands.");
132
133 Loop *L = LI->getLoopFor(Phi->getParent());
134 if (isHeaderBB(Phi->getParent(), L)) {
135 // For header phis, make sure the incoming value from the loop
136 // predecessor is the first operand of the recipe.
137 assert(Phi->getNumOperands() == 2);
138 BasicBlock *LoopPred = L->getLoopPredecessor();
139 VPPhi->addIncoming(
140 getOrCreateVPOperand(Phi->getIncomingValueForBlock(LoopPred)),
141 BB2VPBB[LoopPred]);
142 BasicBlock *LoopLatch = L->getLoopLatch();
143 VPPhi->addIncoming(
144 getOrCreateVPOperand(Phi->getIncomingValueForBlock(LoopLatch)),
145 BB2VPBB[LoopLatch]);
146 continue;
147 }
148
149 for (unsigned I = 0; I != Phi->getNumOperands(); ++I)
150 VPPhi->addIncoming(getOrCreateVPOperand(Phi->getIncomingValue(I)),
151 BB2VPBB[Phi->getIncomingBlock(I)]);
152 }
153}
154
155static bool isHeaderVPBB(VPBasicBlock *VPBB) {
156 return VPBB->getParent() && VPBB->getParent()->getEntry() == VPBB;
157}
158
159/// Return true of \p L loop is contained within \p OuterLoop.
160static bool doesContainLoop(const Loop *L, const Loop *OuterLoop) {
161 if (L->getLoopDepth() < OuterLoop->getLoopDepth())
162 return false;
163 const Loop *P = L;
164 while (P) {
165 if (P == OuterLoop)
166 return true;
167 P = P->getParentLoop();
168 }
169 return false;
170}
171
172// Create a new empty VPBasicBlock for an incoming BasicBlock in the region
173// corresponding to the containing loop or retrieve an existing one if it was
174// already created. If no region exists yet for the loop containing \p BB, a new
175// one is created.
176VPBasicBlock *PlainCFGBuilder::getOrCreateVPBB(BasicBlock *BB) {
177 if (auto *VPBB = BB2VPBB.lookup(BB)) {
178 // Retrieve existing VPBB.
179 return VPBB;
180 }
181
182 // Create new VPBB.
183 StringRef Name = isHeaderBB(BB, TheLoop) ? "vector.body" : BB->getName();
184 LLVM_DEBUG(dbgs() << "Creating VPBasicBlock for " << Name << "\n");
185 VPBasicBlock *VPBB = new VPBasicBlock(Name);
186 BB2VPBB[BB] = VPBB;
187
188 // Get or create a region for the loop containing BB.
189 Loop *LoopOfBB = LI->getLoopFor(BB);
190 if (!LoopOfBB || !doesContainLoop(LoopOfBB, TheLoop))
191 return VPBB;
192
193 auto *RegionOfVPBB = Loop2Region.lookup(LoopOfBB);
194 if (!isHeaderBB(BB, LoopOfBB)) {
195 assert(RegionOfVPBB &&
196 "Region should have been created by visiting header earlier");
197 VPBB->setParent(RegionOfVPBB);
198 return VPBB;
199 }
200
201 assert(!RegionOfVPBB &&
202 "First visit of a header basic block expects to register its region.");
203 // Handle a header - take care of its Region.
204 if (LoopOfBB == TheLoop) {
205 RegionOfVPBB = Plan.getVectorLoopRegion();
206 } else {
207 RegionOfVPBB = new VPRegionBlock(Name.str(), false /*isReplicator*/);
208 RegionOfVPBB->setParent(Loop2Region[LoopOfBB->getParentLoop()]);
209 }
210 RegionOfVPBB->setEntry(VPBB);
211 Loop2Region[LoopOfBB] = RegionOfVPBB;
212 return VPBB;
213}
214
215#ifndef NDEBUG
216// Return true if \p Val is considered an external definition. An external
217// definition is either:
218// 1. A Value that is not an Instruction. This will be refined in the future.
219// 2. An Instruction that is outside of the CFG snippet represented in VPlan,
220// i.e., is not part of: a) the loop nest, b) outermost loop PH and, c)
221// outermost loop exits.
222bool PlainCFGBuilder::isExternalDef(Value *Val) {
223 // All the Values that are not Instructions are considered external
224 // definitions for now.
225 Instruction *Inst = dyn_cast<Instruction>(Val);
226 if (!Inst)
227 return true;
228
229 BasicBlock *InstParent = Inst->getParent();
230 assert(InstParent && "Expected instruction parent.");
231
232 // Check whether Instruction definition is in loop PH.
233 BasicBlock *PH = TheLoop->getLoopPreheader();
234 assert(PH && "Expected loop pre-header.");
235
236 if (InstParent == PH)
237 // Instruction definition is in outermost loop PH.
238 return false;
239
240 // Check whether Instruction definition is in the loop exit.
241 BasicBlock *Exit = TheLoop->getUniqueExitBlock();
242 assert(Exit && "Expected loop with single exit.");
243 if (InstParent == Exit) {
244 // Instruction definition is in outermost loop exit.
245 return false;
246 }
247
248 // Check whether Instruction definition is in loop body.
249 return !TheLoop->contains(Inst);
250}
251#endif
252
253// Create a new VPValue or retrieve an existing one for the Instruction's
254// operand \p IRVal. This function must only be used to create/retrieve VPValues
255// for *Instruction's operands* and not to create regular VPInstruction's. For
256// the latter, please, look at 'createVPInstructionsForVPBB'.
257VPValue *PlainCFGBuilder::getOrCreateVPOperand(Value *IRVal) {
258 auto VPValIt = IRDef2VPValue.find(IRVal);
259 if (VPValIt != IRDef2VPValue.end())
260 // Operand has an associated VPInstruction or VPValue that was previously
261 // created.
262 return VPValIt->second;
263
264 // Operand doesn't have a previously created VPInstruction/VPValue. This
265 // means that operand is:
266 // A) a definition external to VPlan,
267 // B) any other Value without specific representation in VPlan.
268 // For now, we use VPValue to represent A and B and classify both as external
269 // definitions. We may introduce specific VPValue subclasses for them in the
270 // future.
271 assert(isExternalDef(IRVal) && "Expected external definition as operand.");
272
273 // A and B: Create VPValue and add it to the pool of external definitions and
274 // to the Value->VPValue map.
275 VPValue *NewVPVal = Plan.getVPValueOrAddLiveIn(IRVal);
276 IRDef2VPValue[IRVal] = NewVPVal;
277 return NewVPVal;
278}
279
280// Create new VPInstructions in a VPBasicBlock, given its BasicBlock
281// counterpart. This function must be invoked in RPO so that the operands of a
282// VPInstruction in \p BB have been visited before (except for Phi nodes).
283void PlainCFGBuilder::createVPInstructionsForVPBB(VPBasicBlock *VPBB,
284 BasicBlock *BB) {
285 VPIRBuilder.setInsertPoint(VPBB);
286 for (Instruction &InstRef : BB->instructionsWithoutDebug(false)) {
287 Instruction *Inst = &InstRef;
288
289 // There shouldn't be any VPValue for Inst at this point. Otherwise, we
290 // visited Inst when we shouldn't, breaking the RPO traversal order.
291 assert(!IRDef2VPValue.count(Inst) &&
292 "Instruction shouldn't have been visited.");
293
294 if (auto *Br = dyn_cast<BranchInst>(Inst)) {
295 // Conditional branch instruction are represented using BranchOnCond
296 // recipes.
297 if (Br->isConditional()) {
298 VPValue *Cond = getOrCreateVPOperand(Br->getCondition());
299 VPBB->appendRecipe(
301 }
302
303 // Skip the rest of the Instruction processing for Branch instructions.
304 continue;
305 }
306
307 VPValue *NewVPV;
308 if (auto *Phi = dyn_cast<PHINode>(Inst)) {
309 // Phi node's operands may have not been visited at this point. We create
310 // an empty VPInstruction that we will fix once the whole plain CFG has
311 // been built.
312 NewVPV = new VPWidenPHIRecipe(Phi);
313 VPBB->appendRecipe(cast<VPWidenPHIRecipe>(NewVPV));
314 PhisToFix.push_back(Phi);
315 } else {
316 // Translate LLVM-IR operands into VPValue operands and set them in the
317 // new VPInstruction.
318 SmallVector<VPValue *, 4> VPOperands;
319 for (Value *Op : Inst->operands())
320 VPOperands.push_back(getOrCreateVPOperand(Op));
321
322 // Build VPInstruction for any arbitrary Instruction without specific
323 // representation in VPlan.
324 NewVPV = cast<VPInstruction>(
325 VPIRBuilder.createNaryOp(Inst->getOpcode(), VPOperands, Inst));
326 }
327
328 IRDef2VPValue[Inst] = NewVPV;
329 }
330}
331
332// Main interface to build the plain CFG.
333void PlainCFGBuilder::buildPlainCFG() {
334 // 0. Reuse the top-level region, vector-preheader and exit VPBBs from the
335 // skeleton. These were created directly rather than via getOrCreateVPBB(),
336 // revisit them now to update BB2VPBB. Note that header/entry and
337 // latch/exiting VPBB's of top-level region have yet to be created.
338 VPRegionBlock *TheRegion = Plan.getVectorLoopRegion();
339 BasicBlock *ThePreheaderBB = TheLoop->getLoopPreheader();
340 assert((ThePreheaderBB->getTerminator()->getNumSuccessors() == 1) &&
341 "Unexpected loop preheader");
342 auto *VectorPreheaderVPBB =
343 cast<VPBasicBlock>(TheRegion->getSinglePredecessor());
344 // ThePreheaderBB conceptually corresponds to both Plan.getPreheader() (which
345 // wraps the original preheader BB) and Plan.getEntry() (which represents the
346 // new vector preheader); here we're interested in setting BB2VPBB to the
347 // latter.
348 BB2VPBB[ThePreheaderBB] = VectorPreheaderVPBB;
349 BasicBlock *LoopExitBB = TheLoop->getUniqueExitBlock();
350 assert(LoopExitBB && "Loops with multiple exits are not supported.");
351 BB2VPBB[LoopExitBB] = cast<VPBasicBlock>(TheRegion->getSingleSuccessor());
352
353 // 1. Scan the body of the loop in a topological order to visit each basic
354 // block after having visited its predecessor basic blocks. Create a VPBB for
355 // each BB and link it to its successor and predecessor VPBBs. Note that
356 // predecessors must be set in the same order as they are in the incomming IR.
357 // Otherwise, there might be problems with existing phi nodes and algorithm
358 // based on predecessors traversal.
359
360 // Loop PH needs to be explicitly visited since it's not taken into account by
361 // LoopBlocksDFS.
362 for (auto &I : *ThePreheaderBB) {
363 if (I.getType()->isVoidTy())
364 continue;
365 IRDef2VPValue[&I] = Plan.getVPValueOrAddLiveIn(&I);
366 }
367
368 LoopBlocksRPO RPO(TheLoop);
369 RPO.perform(LI);
370
371 for (BasicBlock *BB : RPO) {
372 // Create or retrieve the VPBasicBlock for this BB and create its
373 // VPInstructions.
374 VPBasicBlock *VPBB = getOrCreateVPBB(BB);
375 VPRegionBlock *Region = VPBB->getParent();
376 createVPInstructionsForVPBB(VPBB, BB);
377 Loop *LoopForBB = LI->getLoopFor(BB);
378 // Set VPBB predecessors in the same order as they are in the incoming BB.
379 if (!isHeaderBB(BB, LoopForBB)) {
380 setVPBBPredsFromBB(VPBB, BB);
381 } else {
382 // BB is a loop header, set the predecessor for the region, except for the
383 // top region, whose predecessor was set when creating VPlan's skeleton.
384 assert(isHeaderVPBB(VPBB) && "isHeaderBB and isHeaderVPBB disagree");
385 if (TheRegion != Region)
386 setRegionPredsFromBB(Region, BB);
387 }
388
389 // Set VPBB successors. We create empty VPBBs for successors if they don't
390 // exist already. Recipes will be created when the successor is visited
391 // during the RPO traversal.
392 auto *BI = cast<BranchInst>(BB->getTerminator());
393 unsigned NumSuccs = succ_size(BB);
394 if (NumSuccs == 1) {
395 auto *Successor = getOrCreateVPBB(BB->getSingleSuccessor());
397 ? Successor->getParent()
398 : static_cast<VPBlockBase *>(Successor));
399 continue;
400 }
401 assert(BI->isConditional() && NumSuccs == 2 && BI->isConditional() &&
402 "block must have conditional branch with 2 successors");
403 // Look up the branch condition to get the corresponding VPValue
404 // representing the condition bit in VPlan (which may be in another VPBB).
405 assert(IRDef2VPValue.contains(BI->getCondition()) &&
406 "Missing condition bit in IRDef2VPValue!");
407 VPBasicBlock *Successor0 = getOrCreateVPBB(BI->getSuccessor(0));
408 VPBasicBlock *Successor1 = getOrCreateVPBB(BI->getSuccessor(1));
409 if (!LoopForBB || BB != LoopForBB->getLoopLatch()) {
410 VPBB->setTwoSuccessors(Successor0, Successor1);
411 continue;
412 }
413 // For a latch we need to set the successor of the region rather than that
414 // of VPBB and it should be set to the exit, i.e., non-header successor,
415 // except for the top region, whose successor was set when creating VPlan's
416 // skeleton.
417 if (TheRegion != Region)
418 Region->setOneSuccessor(isHeaderVPBB(Successor0) ? Successor1
419 : Successor0);
420 Region->setExiting(VPBB);
421 }
422
423 // 2. The whole CFG has been built at this point so all the input Values must
424 // have a VPlan couterpart. Fix VPlan phi nodes by adding their corresponding
425 // VPlan operands.
426 fixPhiNodes();
427}
428
429void VPlanHCFGBuilder::buildPlainCFG() {
430 PlainCFGBuilder PCFGBuilder(TheLoop, LI, Plan);
431 PCFGBuilder.buildPlainCFG();
432}
433
434// Public interface to build a H-CFG.
436 // Build Top Region enclosing the plain CFG.
437 buildPlainCFG();
438 LLVM_DEBUG(Plan.setName("HCFGBuilder: Plain CFG\n"); dbgs() << Plan);
439
440 VPRegionBlock *TopRegion = Plan.getVectorLoopRegion();
441 Verifier.verifyHierarchicalCFG(TopRegion);
442
443 // Compute plain CFG dom tree for VPLInfo.
444 VPDomTree.recalculate(Plan);
445 LLVM_DEBUG(dbgs() << "Dominator Tree after building the plain CFG.\n";
446 VPDomTree.print(dbgs()));
447}
#define LLVM_DEBUG(X)
Definition: Debug.h:101
std::string Name
This file provides a LoopVectorizationPlanner class.
#define I(x, y, z)
Definition: MD5.cpp:58
#define P(N)
const SmallVectorImpl< MachineOperand > & Cond
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isHeaderBB(BasicBlock *BB, Loop *L)
static bool doesContainLoop(const Loop *L, const Loop *OuterLoop)
Return true of L loop is contained within OuterLoop.
static bool isHeaderVPBB(VPBasicBlock *VPBB)
This file defines the VPlanHCFGBuilder class which contains the public interface (buildHierarchicalCF...
LLVM Basic Block Representation.
Definition: BasicBlock.h:60
iterator_range< filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> > > instructionsWithoutDebug(bool SkipPseudoOp=true) const
Return a const iterator range over the instructions in the block, skipping any debug instructions.
Definition: BasicBlock.cpp:288
const BasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor block.
Definition: BasicBlock.cpp:491
const BasicBlock * getSingleSuccessor() const
Return the successor of this block if it has a single successor.
Definition: BasicBlock.cpp:521
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
Definition: BasicBlock.h:228
This class represents an Operation in the Expression.
void print(raw_ostream &O) const
print - Convert to human readable form
void recalculate(ParentType &Func)
recalculate - compute a dominator tree for the given function
unsigned getNumSuccessors() const LLVM_READONLY
Return the number of successors that this instruction has.
const BasicBlock * getParent() const
Definition: Instruction.h:149
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
Definition: Instruction.h:249
BlockT * getLoopLatch() const
If there is a single latch block for this loop, return it.
unsigned getLoopDepth() const
Return the nesting level of this loop.
BlockT * getLoopPredecessor() const
If the given loop's header has exactly one unique predecessor outside the loop, return it.
LoopT * getParentLoop() const
Return the parent loop if it exists or nullptr for top level loops.
Wrapper class to LoopBlocksDFS that provides a standard begin()/end() interface for the DFS reverse p...
Definition: LoopIterator.h:172
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:44
void push_back(const T &Elt)
Definition: SmallVector.h:426
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
op_range operands()
Definition: User.h:242
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
Definition: VPlan.h:2585
void appendRecipe(VPRecipeBase *Recipe)
Augment the existing recipes of a VPBasicBlock with an additional Recipe as the last recipe.
Definition: VPlan.h:2653
VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
Definition: VPlan.h:419
VPRegionBlock * getParent()
Definition: VPlan.h:491
void setPredecessors(ArrayRef< VPBlockBase * > NewPreds)
Set each VPBasicBlock in NewPreds as predecessor of this VPBlockBase.
Definition: VPlan.h:605
void setTwoSuccessors(VPBlockBase *IfTrue, VPBlockBase *IfFalse)
Set two given VPBlockBases IfTrue and IfFalse to be the two successors of this VPBlockBase.
Definition: VPlan.h:596
VPBlockBase * getSinglePredecessor() const
Definition: VPlan.h:532
void setOneSuccessor(VPBlockBase *Successor)
Set a given VPBlockBase Successor as the single successor of this VPBlockBase.
Definition: VPlan.h:585
void setParent(VPRegionBlock *P)
Definition: VPlan.h:502
VPBlockBase * getSingleSuccessor() const
Definition: VPlan.h:526
VPlan-based builder utility analogous to IRBuilder.
This is a concrete Recipe that models a single VPlan-level instruction.
Definition: VPlan.h:1137
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
Definition: VPlan.h:2718
const VPBlockBase * getEntry() const
Definition: VPlan.h:2757
A recipe for handling header phis that are widened in the vector loop.
Definition: VPlan.h:1742
void buildHierarchicalCFG()
Build H-CFG for TheLoop and update Plan accordingly.
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition: VPlan.h:2819
void setName(const Twine &newName)
Definition: VPlan.h:2968
VPRegionBlock * getVectorLoopRegion()
Returns the VPRegionBlock of the vector loop.
Definition: VPlan.h:3027
LLVM Value Representation.
Definition: Value.h:74
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:309
NodeAddr< PhiNode * > Phi
Definition: RDFGraph.h:390
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
auto predecessors(const MachineBasicBlock *BB)
unsigned succ_size(const MachineBasicBlock *BB)
void verifyHierarchicalCFG(const VPRegionBlock *TopRegion) const
Verify the invariants of the H-CFG starting from TopRegion.