summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/include/polly/ScopInfo.h8
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp1
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp4
3 files changed, 11 insertions, 2 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index 18df27bc636..a784f31c851 100644
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -3029,7 +3029,9 @@ public:
class ScopInfo {
public:
- using RegionToScopMapTy = DenseMap<Region *, std::unique_ptr<Scop>>;
+ using RegionToScopMapTy = MapVector<Region *, std::unique_ptr<Scop>>;
+ using reverse_iterator = RegionToScopMapTy::reverse_iterator;
+ using const_reverse_iterator = RegionToScopMapTy::const_reverse_iterator;
using iterator = RegionToScopMapTy::iterator;
using const_iterator = RegionToScopMapTy::const_iterator;
@@ -3060,6 +3062,10 @@ public:
iterator end() { return RegionToScopMap.end(); }
const_iterator begin() const { return RegionToScopMap.begin(); }
const_iterator end() const { return RegionToScopMap.end(); }
+ reverse_iterator rbegin() { return RegionToScopMap.rbegin(); }
+ reverse_iterator rend() { return RegionToScopMap.rend(); }
+ const_reverse_iterator rbegin() const { return RegionToScopMap.rbegin(); }
+ const_reverse_iterator rend() const { return RegionToScopMap.rend(); }
bool empty() const { return RegionToScopMap.empty(); }
};
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index a2bbb71b3d8..18496d487b8 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -1804,6 +1804,7 @@ ScopDetection ScopAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
PreservedAnalyses ScopAnalysisPrinterPass::run(Function &F,
FunctionAnalysisManager &FAM) {
+ Stream << "Detected Scops in Function " << F.getName() << "\n";
auto &SD = FAM.getResult<ScopAnalysis>(F);
for (const Region *R : SD.ValidRegions)
Stream << "Valid Region for Scop: " << R->getNameStr() << '\n';
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 1da1625f5f0..515a5056cd3 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -5290,7 +5290,9 @@ ScopInfoAnalysis::Result ScopInfoAnalysis::run(Function &F,
PreservedAnalyses ScopInfoPrinterPass::run(Function &F,
FunctionAnalysisManager &FAM) {
auto &SI = FAM.getResult<ScopInfoAnalysis>(F);
- for (auto &It : SI) {
+ // Since the legacy PM processes Scops in bottom up, we print them in reverse
+ // order here to keep the output persistent
+ for (auto &It : reverse(SI)) {
if (It.second)
It.second->print(Stream, PollyPrintInstructions);
else
OpenPOWER on IntegriCloud