aboutsummaryrefslogtreecommitdiff
path: root/polly
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2017-07-18 15:41:49 +0000
committerMichael Kruse <llvm@meinersbur.de>2017-07-18 15:41:49 +0000
commit4dfa732750476fb5a1f9fef78cb311a87ca9da51 (patch)
tree476b854025a334b7048954acbc7ad5b77029fa4d /polly
parentfad872fc2df3bdb144f3d5c0191a1e43035b022a (diff)
downloadllvm-4dfa732750476fb5a1f9fef78cb311a87ca9da51.zip
llvm-4dfa732750476fb5a1f9fef78cb311a87ca9da51.tar.gz
llvm-4dfa732750476fb5a1f9fef78cb311a87ca9da51.tar.bz2
[ScopInfo] Introduce list of statements in Scop::StmtMap. NFC.
Once statements are split, a BasicBlock will comprise of multiple statements. To prepare for this change in future, we introduce a list of statements in the statement map. Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D35301 llvm-svn: 308318
Diffstat (limited to 'polly')
-rw-r--r--polly/include/polly/ScopInfo.h5
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp7
2 files changed, 7 insertions, 5 deletions
diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h
index edf40d6b..27f79ba 100644
--- a/polly/include/polly/ScopInfo.h
+++ b/polly/include/polly/ScopInfo.h
@@ -1670,8 +1670,9 @@ private:
/// delete the last object that creates isl objects with the context.
std::shared_ptr<isl_ctx> IslCtx;
- /// A map from basic blocks to SCoP statements.
- DenseMap<BasicBlock *, ScopStmt *> StmtMap;
+ /// A map from basic blocks to vector of SCoP statements. Currently this
+ /// vector comprises only of a single statement.
+ DenseMap<BasicBlock *, std::vector<ScopStmt *>> StmtMap;
/// A map from basic blocks to their domains.
DenseMap<BasicBlock *, isl::set> DomainMap;
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 0f23526..d0247e8 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -4748,7 +4748,7 @@ void Scop::addScopStmt(BasicBlock *BB, Loop *SurroundingLoop,
assert(BB && "Unexpected nullptr!");
Stmts.emplace_back(*this, *BB, SurroundingLoop, Instructions);
auto *Stmt = &Stmts.back();
- StmtMap[BB] = Stmt;
+ StmtMap[BB].push_back(Stmt);
}
void Scop::addScopStmt(Region *R, Loop *SurroundingLoop) {
@@ -4756,7 +4756,7 @@ void Scop::addScopStmt(Region *R, Loop *SurroundingLoop) {
Stmts.emplace_back(*this, *R, SurroundingLoop);
auto *Stmt = &Stmts.back();
for (BasicBlock *BB : R->blocks())
- StmtMap[BB] = Stmt;
+ StmtMap[BB].push_back(Stmt);
}
ScopStmt *Scop::addScopStmt(__isl_take isl_map *SourceRel,
@@ -4908,7 +4908,8 @@ ScopStmt *Scop::getStmtFor(BasicBlock *BB) const {
auto StmtMapIt = StmtMap.find(BB);
if (StmtMapIt == StmtMap.end())
return nullptr;
- return StmtMapIt->second;
+ assert(StmtMapIt->second.size() == 1);
+ return StmtMapIt->second.front();
}
ScopStmt *Scop::getStmtFor(RegionNode *RN) const {