summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
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/unittests/Transforms/Vectorize/VPlanTestBase.h
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/unittests/Transforms/Vectorize/VPlanTestBase.h')
-rw-r--r--llvm/unittests/Transforms/Vectorize/VPlanTestBase.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h b/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
index da3b39f4df0..0fc4a9a21c8 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
+++ b/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
@@ -50,8 +50,19 @@ protected:
doAnalysis(*LoopHeader->getParent());
auto Plan = llvm::make_unique<VPlan>();
- VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get());
- HCFGBuilder.buildHierarchicalCFG(*Plan.get());
+ VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan);
+ HCFGBuilder.buildHierarchicalCFG();
+ return Plan;
+ }
+
+ /// Build the VPlan plain CFG for the loop starting from \p LoopHeader.
+ VPlanPtr buildPlainCFG(BasicBlock *LoopHeader) {
+ doAnalysis(*LoopHeader->getParent());
+
+ auto Plan = llvm::make_unique<VPlan>();
+ VPlanHCFGBuilder HCFGBuilder(LI->getLoopFor(LoopHeader), LI.get(), *Plan);
+ VPRegionBlock *TopRegion = HCFGBuilder.buildPlainCFG();
+ Plan->setEntry(TopRegion);
return Plan;
}
};
OpenPOWER on IntegriCloud