diff options
| author | Michael Kruse <llvm@meinersbur.de> | 2017-07-20 17:18:58 +0000 |
|---|---|---|
| committer | Michael Kruse <llvm@meinersbur.de> | 2017-07-20 17:18:58 +0000 |
| commit | 1ce6791e7e022ef6b2f3926f37b7f614f676d72f (patch) | |
| tree | 08947daeffa3c8d5ca166cacee8782b7d0764ea3 | |
| parent | 4b1008af7327d5dbd95c845dced834785b9b8d5a (diff) | |
| download | bcm5719-llvm-1ce6791e7e022ef6b2f3926f37b7f614f676d72f.tar.gz bcm5719-llvm-1ce6791e7e022ef6b2f3926f37b7f614f676d72f.zip | |
[ScopInfo] Get a list of statements for a region node. NFC.
When constructing a schedule true and there are multiple statements for
a basic block, create a sequence node for these statements.
Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in>
Differential Revision: https://reviews.llvm.org/D35679
llvm-svn: 308635
| -rw-r--r-- | polly/include/polly/ScopInfo.h | 8 | ||||
| -rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 14 |
2 files changed, 10 insertions, 12 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index f4dd6d51255..215405bc820 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -2678,14 +2678,14 @@ public: /// to be executed last, only that the incoming value is available in it. ScopStmt *getLastStmtFor(BasicBlock *BB) const; - /// Return the ScopStmt that represents the Region @p R, or nullptr if + /// Return the ScopStmts that represents the Region @p R, or nullptr if /// it is not represented by any statement in this Scop. - ScopStmt *getStmtFor(Region *R) const; + ArrayRef<ScopStmt *> getStmtListFor(Region *R) const; - /// Return the ScopStmt that represents @p RN; can return nullptr if + /// Return the ScopStmts that represents @p RN; can return nullptr if /// the RegionNode is not within the SCoP or has been removed due to /// simplifications. - ScopStmt *getStmtFor(RegionNode *RN) const; + ArrayRef<ScopStmt *> getStmtListFor(RegionNode *RN) const; /// Return the ScopStmt an instruction belongs to, or nullptr if it /// does not belong to any statement in this Scop. diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 49f29613654..a1643f8b01a 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -4935,7 +4935,7 @@ void Scop::buildSchedule(RegionNode *RN, LoopStackTy &LoopStack, LoopInfo &LI) { auto &LoopData = LoopStack.back(); LoopData.NumBlocksProcessed += getNumBlocksInRegionNode(RN); - if (auto *Stmt = getStmtFor(RN)) { + for (auto *Stmt : getStmtListFor(RN)) { auto *UDomain = isl_union_set_from_set(Stmt->getDomain()); auto *StmtSchedule = isl_schedule_from_domain(UDomain); LoopData.Schedule = combineInSequence(LoopData.Schedule, StmtSchedule); @@ -4995,16 +4995,14 @@ ScopStmt *Scop::getLastStmtFor(BasicBlock *BB) const { return nullptr; } -ScopStmt *Scop::getStmtFor(RegionNode *RN) const { +ArrayRef<ScopStmt *> Scop::getStmtListFor(RegionNode *RN) const { if (RN->isSubRegion()) - return getStmtFor(RN->getNodeAs<Region>()); - return getStmtFor(RN->getNodeAs<BasicBlock>()); + return getStmtListFor(RN->getNodeAs<Region>()); + return getStmtListFor(RN->getNodeAs<BasicBlock>()); } -ScopStmt *Scop::getStmtFor(Region *R) const { - ScopStmt *Stmt = getStmtFor(R->getEntry()); - assert(!Stmt || Stmt->getRegion() == R); - return Stmt; +ArrayRef<ScopStmt *> Scop::getStmtListFor(Region *R) const { + return getStmtListFor(R->getEntry()); } int Scop::getRelativeLoopDepth(const Loop *L) const { |

