summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
diff options
context:
space:
mode:
authorDiego Caballero <diego.caballero@intel.com>2018-07-30 21:33:31 +0000
committerDiego Caballero <diego.caballero@intel.com>2018-07-30 21:33:31 +0000
commit2a34ac86d3ea99f6ae8ec94935436ed0b26ddc14 (patch)
treec7d0a946a83dec77a91115f700aeb75080174869 /llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
parent47ad09b339f3d58e37e4f011a01b7d4dcbb3c6c3 (diff)
downloadbcm5719-llvm-2a34ac86d3ea99f6ae8ec94935436ed0b26ddc14.tar.gz
bcm5719-llvm-2a34ac86d3ea99f6ae8ec94935436ed0b26ddc14.zip
[VPlan] Introduce VPlan-based dominator analysis.
The patch introduces dominator analysis for VPBlockBases and extend VPlan's GraphTraits specialization with the required interfaces. Dominator analysis will be necessary to perform some H-CFG transformations and to introduce VPLoopInfo (LoopInfo analysis on top of the VPlan representation). Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D48815 llvm-svn: 338310
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp b/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
index 08129b74cdd..26e112e02db 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp
@@ -324,13 +324,22 @@ VPRegionBlock *PlainCFGBuilder::buildPlainCFG() {
return TopRegion;
}
+VPRegionBlock *VPlanHCFGBuilder::buildPlainCFG() {
+ PlainCFGBuilder PCFGBuilder(TheLoop, LI, Plan);
+ return PCFGBuilder.buildPlainCFG();
+}
+
// Public interface to build a H-CFG.
-void VPlanHCFGBuilder::buildHierarchicalCFG(VPlan &Plan) {
+void VPlanHCFGBuilder::buildHierarchicalCFG() {
// Build Top Region enclosing the plain CFG and set it as VPlan entry.
- PlainCFGBuilder PCFGBuilder(TheLoop, LI, Plan);
- VPRegionBlock *TopRegion = PCFGBuilder.buildPlainCFG();
+ VPRegionBlock *TopRegion = buildPlainCFG();
Plan.setEntry(TopRegion);
LLVM_DEBUG(Plan.setName("HCFGBuilder: Plain CFG\n"); dbgs() << Plan);
Verifier.verifyHierarchicalCFG(TopRegion);
+
+ // Compute plain CFG dom tree for VPLInfo.
+ VPDomTree.recalculate(*TopRegion);
+ LLVM_DEBUG(dbgs() << "Dominator Tree after building the plain CFG.\n";
+ VPDomTree.print(dbgs()));
}
OpenPOWER on IntegriCloud