From 8ca36815eec998bbc21d2749fe6029812d60725a Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 19 Jul 2014 18:40:17 +0000 Subject: [PATCH] Update for RegionInfo changes. Mostly related to missing includes and renaming of the pass to RegionInfoPass. llvm-svn: 213457 --- polly/lib/Analysis/ScopDetection.cpp | 7 ++++--- polly/lib/Analysis/ScopGraphPrinter.cpp | 2 +- polly/lib/Analysis/ScopInfo.cpp | 4 ++-- polly/lib/Analysis/TempScopInfo.cpp | 3 ++- polly/lib/CodeGen/CodeGeneration.cpp | 6 +++--- polly/lib/CodeGen/IslCodeGeneration.cpp | 7 ++++--- polly/lib/CodeGen/Utils.cpp | 2 +- polly/lib/Support/ScopHelper.cpp | 4 ++-- polly/lib/Transform/CodePreparation.cpp | 3 ++- polly/lib/Transform/IndependentBlocks.cpp | 10 ++++++---- 10 files changed, 27 insertions(+), 21 deletions(-) diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index f061f01..75d6731 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -54,6 +54,7 @@ #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/RegionIterator.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" @@ -819,7 +820,7 @@ void ScopDetection::emitMissedRemarksForLeaves(const Function &F, bool ScopDetection::runOnFunction(llvm::Function &F) { LI = &getAnalysis(); - RI = &getAnalysis(); + RI = &getAnalysis().getRegionInfo(); if (!DetectScopsWithoutLoops && LI->empty()) return false; @@ -873,7 +874,7 @@ void ScopDetection::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); // We also need AA and RegionInfo when we are verifying analysis. AU.addRequiredTransitive(); - AU.addRequiredTransitive(); + AU.addRequiredTransitive(); AU.setPreservesAll(); } @@ -902,7 +903,7 @@ INITIALIZE_AG_DEPENDENCY(AliasAnalysis); INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass); INITIALIZE_PASS_DEPENDENCY(LoopInfo); INITIALIZE_PASS_DEPENDENCY(PostDominatorTree); -INITIALIZE_PASS_DEPENDENCY(RegionInfo); +INITIALIZE_PASS_DEPENDENCY(RegionInfoPass); INITIALIZE_PASS_DEPENDENCY(ScalarEvolution); INITIALIZE_PASS_END(ScopDetection, "polly-detect", "Polly - Detect static control parts (SCoPs)", false, false) diff --git a/polly/lib/Analysis/ScopGraphPrinter.cpp b/polly/lib/Analysis/ScopGraphPrinter.cpp index dfcbec9..d45d758 100644 --- a/polly/lib/Analysis/ScopGraphPrinter.cpp +++ b/polly/lib/Analysis/ScopGraphPrinter.cpp @@ -91,7 +91,7 @@ struct DOTGraphTraits : public DOTGraphTraits { std::string getNodeLabel(RegionNode *Node, ScopDetection *SD) { return DOTGraphTraits::getNodeLabel( - Node, SD->getRI()->getTopLevelRegion()); + Node, reinterpret_cast(SD->getRI()->getTopLevelRegion())); } static std::string escapeString(std::string String) { diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 7b34890..e462c77 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -1436,7 +1436,7 @@ ScopInfo::~ScopInfo() { void ScopInfo::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); - AU.addRequired(); + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.setPreservesAll(); @@ -1472,7 +1472,7 @@ INITIALIZE_PASS_BEGIN(ScopInfo, "polly-scops", "Polly - Create polyhedral description of Scops", false, false); INITIALIZE_PASS_DEPENDENCY(LoopInfo); -INITIALIZE_PASS_DEPENDENCY(RegionInfo); +INITIALIZE_PASS_DEPENDENCY(RegionInfoPass); INITIALIZE_PASS_DEPENDENCY(ScalarEvolution); INITIALIZE_PASS_DEPENDENCY(TempScopInfo); INITIALIZE_PASS_END(ScopInfo, "polly-scops", diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp index 2901c93..5dd3423 100644 --- a/polly/lib/Analysis/TempScopInfo.cpp +++ b/polly/lib/Analysis/TempScopInfo.cpp @@ -23,6 +23,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/RegionIterator.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" @@ -395,7 +396,7 @@ INITIALIZE_AG_DEPENDENCY(AliasAnalysis); INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass); INITIALIZE_PASS_DEPENDENCY(LoopInfo); INITIALIZE_PASS_DEPENDENCY(PostDominatorTree); -INITIALIZE_PASS_DEPENDENCY(RegionInfo); +INITIALIZE_PASS_DEPENDENCY(RegionInfoPass); INITIALIZE_PASS_DEPENDENCY(ScalarEvolution); INITIALIZE_PASS_DEPENDENCY(DataLayoutPass); INITIALIZE_PASS_END(TempScopInfo, "polly-analyze-ir", diff --git a/polly/lib/CodeGen/CodeGeneration.cpp b/polly/lib/CodeGen/CodeGeneration.cpp index 59373e5..1f093fb 100644 --- a/polly/lib/CodeGen/CodeGeneration.cpp +++ b/polly/lib/CodeGen/CodeGeneration.cpp @@ -1051,7 +1051,7 @@ public: AU.addRequired(); AU.addRequired(); AU.addRequired(); - AU.addRequired(); + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.addRequired(); @@ -1067,7 +1067,7 @@ public: // FIXME: We do not yet add regions for the newly generated code to the // region tree. - AU.addPreserved(); + AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); AU.addPreservedID(IndependentBlocksID); @@ -1084,7 +1084,7 @@ INITIALIZE_PASS_BEGIN(CodeGeneration, "polly-codegen", INITIALIZE_PASS_DEPENDENCY(CloogInfo); INITIALIZE_PASS_DEPENDENCY(Dependences); INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass); -INITIALIZE_PASS_DEPENDENCY(RegionInfo); +INITIALIZE_PASS_DEPENDENCY(RegionInfoPass); INITIALIZE_PASS_DEPENDENCY(ScalarEvolution); INITIALIZE_PASS_DEPENDENCY(ScopDetection); INITIALIZE_PASS_DEPENDENCY(DataLayoutPass); diff --git a/polly/lib/CodeGen/IslCodeGeneration.cpp b/polly/lib/CodeGen/IslCodeGeneration.cpp index b4d11b2..4eb39cc 100644 --- a/polly/lib/CodeGen/IslCodeGeneration.cpp +++ b/polly/lib/CodeGen/IslCodeGeneration.cpp @@ -31,6 +31,7 @@ #include "polly/Support/ScopHelper.h" #include "polly/TempScopInfo.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/ScalarEvolutionExpander.h" #include "llvm/IR/Module.h" #include "llvm/Support/CommandLine.h" @@ -1175,7 +1176,7 @@ public: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.addRequired(); - AU.addRequired(); + AU.addRequired(); AU.addRequired(); AU.addRequired(); AU.addRequired(); @@ -1191,7 +1192,7 @@ public: // FIXME: We do not yet add regions for the newly generated code to the // region tree. - AU.addPreserved(); + AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); AU.addPreservedID(IndependentBlocksID); @@ -1208,7 +1209,7 @@ INITIALIZE_PASS_BEGIN(IslCodeGeneration, "polly-codegen-isl", INITIALIZE_PASS_DEPENDENCY(Dependences); INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass); INITIALIZE_PASS_DEPENDENCY(LoopInfo); -INITIALIZE_PASS_DEPENDENCY(RegionInfo); +INITIALIZE_PASS_DEPENDENCY(RegionInfoPass); INITIALIZE_PASS_DEPENDENCY(ScalarEvolution); INITIALIZE_PASS_DEPENDENCY(ScopDetection); INITIALIZE_PASS_END(IslCodeGeneration, "polly-codegen-isl", diff --git a/polly/lib/CodeGen/Utils.cpp b/polly/lib/CodeGen/Utils.cpp index 7eaac37..36722d3 100644 --- a/polly/lib/CodeGen/Utils.cpp +++ b/polly/lib/CodeGen/Utils.cpp @@ -26,7 +26,7 @@ BasicBlock *polly::executeScopConditionally(Scop &S, Pass *PassInfo) { PollyIRBuilder Builder(R.getEntry()); DominatorTree &DT = PassInfo->getAnalysis().getDomTree(); - RegionInfo &RI = PassInfo->getAnalysis(); + RegionInfo &RI = PassInfo->getAnalysis().getRegionInfo(); LoopInfo &LI = PassInfo->getAnalysis(); // Split the entry edge of the region and generate a new basic block on this diff --git a/polly/lib/Support/ScopHelper.cpp b/polly/lib/Support/ScopHelper.cpp index 3e3a535..15adf2d 100644 --- a/polly/lib/Support/ScopHelper.cpp +++ b/polly/lib/Support/ScopHelper.cpp @@ -121,6 +121,6 @@ void polly::splitEntryBlockForAlloca(BasicBlock *EntryBlock, Pass *P) { // SplitBlock updates DT, DF and LI. BasicBlock *NewEntry = SplitBlock(EntryBlock, I, P); - if (RegionInfo *RI = P->getAnalysisIfAvailable()) - RI->splitBlock(NewEntry, EntryBlock); + if (RegionInfoPass *RIP = P->getAnalysisIfAvailable()) + RIP->getRegionInfo().splitBlock(NewEntry, EntryBlock); } diff --git a/polly/lib/Transform/CodePreparation.cpp b/polly/lib/Transform/CodePreparation.cpp index 0989fe5..40d2723 100644 --- a/polly/lib/Transform/CodePreparation.cpp +++ b/polly/lib/Transform/CodePreparation.cpp @@ -40,6 +40,7 @@ #include "polly/LinkAllPasses.h" #include "polly/CodeGen/BlockGenerators.h" #include "polly/Support/ScopHelper.h" +#include "llvm/Analysis/DominanceFrontier.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/RegionInfo.h" #include "llvm/Analysis/ScalarEvolution.h" @@ -215,7 +216,7 @@ void CodePreparation::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.addPreserved(); - AU.addPreserved(); + AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); } diff --git a/polly/lib/Transform/IndependentBlocks.cpp b/polly/lib/Transform/IndependentBlocks.cpp index aca71f3..1894f45 100644 --- a/polly/lib/Transform/IndependentBlocks.cpp +++ b/polly/lib/Transform/IndependentBlocks.cpp @@ -17,7 +17,9 @@ #include "polly/CodeGen/Cloog.h" #include "polly/ScopDetection.h" #include "polly/Support/ScopHelper.h" +#include "llvm/Analysis/DominanceFrontier.h" #include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/RegionInfo.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/Transforms/Utils/Local.h" @@ -494,8 +496,8 @@ void IndependentBlocks::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); - AU.addRequired(); - AU.addPreserved(); + AU.addRequired(); + AU.addPreserved(); AU.addRequired(); AU.addPreserved(); AU.addRequired(); @@ -510,7 +512,7 @@ void IndependentBlocks::getAnalysisUsage(AnalysisUsage &AU) const { bool IndependentBlocks::runOnFunction(llvm::Function &F) { bool Changed = false; - RI = &getAnalysis(); + RI = &getAnalysis().getRegionInfo(); LI = &getAnalysis(); SD = &getAnalysis(); SE = &getAnalysis(); @@ -557,7 +559,7 @@ Pass *polly::createIndependentBlocksPass() { return new IndependentBlocks(); } INITIALIZE_PASS_BEGIN(IndependentBlocks, "polly-independent", "Polly - Create independent blocks", false, false); INITIALIZE_PASS_DEPENDENCY(LoopInfo); -INITIALIZE_PASS_DEPENDENCY(RegionInfo); +INITIALIZE_PASS_DEPENDENCY(RegionInfoPass); INITIALIZE_PASS_DEPENDENCY(ScalarEvolution); INITIALIZE_PASS_DEPENDENCY(ScopDetection); INITIALIZE_PASS_END(IndependentBlocks, "polly-independent", -- 2.7.4