summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/include/polly/ScopInfo.h4
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp10
2 files changed, 11 insertions, 3 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index b1d6323d552..f81a392cd4f 100644
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -1083,6 +1083,10 @@ public:
/// statements, return its entry block.
BasicBlock *getEntryBlock() const;
+ /// @brief Return RegionInfo's RegionNode for this statements' BB or
+ /// subregion.
+ RegionNode *getRegionNode() const;
+
/// @brief Return true if this statement does not contain any accesses.
bool isEmpty() const { return MemAccs.empty(); }
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 95fc0211205..dc18d618b3b 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1536,6 +1536,12 @@ BasicBlock *ScopStmt::getEntryBlock() const {
return getRegion()->getEntry();
}
+RegionNode *ScopStmt::getRegionNode() const {
+ if (isRegionStmt())
+ return getRegion()->getNode();
+ return getParent()->getRegion().getBBNode(getBasicBlock());
+}
+
unsigned ScopStmt::getNumParams() const { return Parent.getNumParams(); }
unsigned ScopStmt::getNumIterators() const { return NestLoops.size(); }
@@ -2875,9 +2881,7 @@ void Scop::simplifySCoP(bool RemoveIgnoredStmts, DominatorTree &DT,
LoopInfo &LI) {
for (auto StmtIt = Stmts.begin(), StmtEnd = Stmts.end(); StmtIt != StmtEnd;) {
ScopStmt &Stmt = *StmtIt;
- RegionNode *RN = Stmt.isRegionStmt()
- ? Stmt.getRegion()->getNode()
- : getRegion().getBBNode(Stmt.getBasicBlock());
+ RegionNode *RN = Stmt.getRegionNode();
bool RemoveStmt = StmtIt->isEmpty();
if (!RemoveStmt)
OpenPOWER on IntegriCloud