diff options
author | Michael Kruse <llvm@meinersbur.de> | 2015-12-13 22:10:37 +0000 |
---|---|---|
committer | Michael Kruse <llvm@meinersbur.de> | 2015-12-13 22:10:37 +0000 |
commit | daf669418c3260d3897f569409e0c3412661cefa (patch) | |
tree | 05bc1d84664f9183e517cf926026b18bcc885990 | |
parent | b06e3029d1e03d457368ac8bb8e9b886d86f9e84 (diff) | |
download | bcm5719-llvm-daf669418c3260d3897f569409e0c3412661cefa.tar.gz bcm5719-llvm-daf669418c3260d3897f569409e0c3412661cefa.zip |
Store DominatorTree as a field in ScopInfo
This harmonizes DT with the other analyses in ScopInfo and makes it
available for use in its methods.
llvm-svn: 255472
-rw-r--r-- | polly/include/polly/ScopInfo.h | 5 | ||||
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index 191071576fb..763befe82e7 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -1783,6 +1783,9 @@ class ScopInfo : public RegionPass { // Target data for element size computing. const DataLayout *TD; + // DominatorTree to reason about guaranteed execution. + DominatorTree *DT; + // Access function of statements (currently BasicBlocks) . // // This owns all the MemoryAccess objects of the Scop created in this pass. It @@ -1804,7 +1807,7 @@ class ScopInfo : public RegionPass { void clear(); // Build the SCoP for Region @p R. - void buildScop(Region &R, DominatorTree &DT, AssumptionCache &AC); + void buildScop(Region &R, AssumptionCache &AC); /// @brief Build an instance of MemoryAccess from the Load/Store instruction. /// diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index c23932b894c..a3f6f3a54c9 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3942,9 +3942,9 @@ void ScopInfo::addPHIReadAccess(PHINode *PHI) { ScopArrayInfo::MK_PHI); } -void ScopInfo::buildScop(Region &R, DominatorTree &DT, AssumptionCache &AC) { +void ScopInfo::buildScop(Region &R, AssumptionCache &AC) { unsigned MaxLoopDepth = getMaxLoopDepthInRegion(R, *LI, *SD); - scop = new Scop(R, AccFuncMap, *SD, *SE, DT, *LI, ctx, MaxLoopDepth); + scop = new Scop(R, AccFuncMap, *SD, *SE, *DT, *LI, ctx, MaxLoopDepth); buildStmts(R); buildAccessFunctions(R, R); @@ -4012,7 +4012,7 @@ bool ScopInfo::runOnRegion(Region *R, RGPassManager &RGM) { LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); AA = &getAnalysis<AAResultsWrapperPass>().getAAResults(); TD = &F->getParent()->getDataLayout(); - DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree(); + DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(*F); DebugLoc Beg, End; @@ -4020,7 +4020,7 @@ bool ScopInfo::runOnRegion(Region *R, RGPassManager &RGM) { std::string Msg = "SCoP begins here."; emitOptimizationRemarkAnalysis(F->getContext(), DEBUG_TYPE, *F, Beg, Msg); - buildScop(*R, DT, AC); + buildScop(*R, AC); DEBUG(scop->print(dbgs())); |