LLVM  14.0.0git
VPlanHCFGBuilder.h
Go to the documentation of this file.
1 //===-- VPlanHCFGBuilder.h --------------------------------------*- C++ -*-===//
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 VPlanHCFGBuilder class which contains the public
11 /// interface (buildHierarchicalCFG) to build a VPlan-based Hierarchical CFG
12 /// (H-CFG) for an incoming IR.
13 ///
14 /// A H-CFG in VPlan is a control-flow graph whose nodes are VPBasicBlocks
15 /// and/or VPRegionBlocks (i.e., other H-CFGs). The outermost H-CFG of a VPlan
16 /// consists of a VPRegionBlock, denoted Top Region, which encloses any other
17 /// VPBlockBase in the H-CFG. This guarantees that any VPBlockBase in the H-CFG
18 /// other than the Top Region will have a parent VPRegionBlock and allows us
19 /// to easily add more nodes before/after the main vector loop (such as the
20 /// reduction epilogue).
21 ///
22 //===----------------------------------------------------------------------===//
23 
24 #ifndef LLVM_TRANSFORMS_VECTORIZE_VPLAN_VPLANHCFGBUILDER_H
25 #define LLVM_TRANSFORMS_VECTORIZE_VPLAN_VPLANHCFGBUILDER_H
26 
27 #include "VPlan.h"
28 #include "VPlanDominatorTree.h"
29 #include "VPlanVerifier.h"
30 
31 namespace llvm {
32 
33 class Loop;
34 class VPlanTestBase;
35 
36 /// Main class to build the VPlan H-CFG for an incoming IR.
38  friend VPlanTestBase;
39 
40 private:
41  // The outermost loop of the input loop nest considered for vectorization.
42  Loop *TheLoop;
43 
44  // Loop Info analysis.
45  LoopInfo *LI;
46 
47  // The VPlan that will contain the H-CFG we are building.
48  VPlan &Plan;
49 
50  // VPlan verifier utility.
51  VPlanVerifier Verifier;
52 
53  // Dominator analysis for VPlan plain CFG to be used in the
54  // construction of the H-CFG. This analysis is no longer valid once regions
55  // are introduced.
56  VPDominatorTree VPDomTree;
57 
58  /// Build plain CFG for TheLoop. Return a new VPRegionBlock (TopRegion)
59  /// enclosing the plain CFG.
60  VPRegionBlock *buildPlainCFG();
61 
62 public:
64  : TheLoop(Lp), LI(LI), Plan(P) {}
65 
66  /// Build H-CFG for TheLoop and update Plan accordingly.
67  void buildHierarchicalCFG();
68 };
69 } // namespace llvm
70 
71 #endif // LLVM_TRANSFORMS_VECTORIZE_VPLAN_VPLANHCFGBUILDER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::Loop
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:530
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::VPlanHCFGBuilder::buildHierarchicalCFG
void buildHierarchicalCFG()
Build H-CFG for TheLoop and update Plan accordingly.
Definition: VPlanHCFGBuilder.cpp:344
llvm::VPlanVerifier
Struct with utility functions that can be used to check the consistency and invariants of a VPlan,...
Definition: VPlanVerifier.h:33
VPlanDominatorTree.h
VPlan.h
llvm::VPRegionBlock
VPRegionBlock represents a collection of VPBasicBlocks and VPRegionBlocks which form a Single-Entry-S...
Definition: VPlan.h:1741
llvm::LoopInfo
Definition: LoopInfo.h:1083
llvm::VPlanHCFGBuilder
Main class to build the VPlan H-CFG for an incoming IR.
Definition: VPlanHCFGBuilder.h:37
llvm::DominatorTreeBase
Core dominator tree base class.
Definition: LoopInfo.h:65
VPlanVerifier.h
llvm::VPlanHCFGBuilder::VPlanHCFGBuilder
VPlanHCFGBuilder(Loop *Lp, LoopInfo *LI, VPlan &P)
Definition: VPlanHCFGBuilder.h:63
llvm::VPlan
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
Definition: VPlan.h:2089