Index: polly/trunk/include/polly/ScopInfo.h =================================================================== --- polly/trunk/include/polly/ScopInfo.h +++ polly/trunk/include/polly/ScopInfo.h @@ -1670,8 +1670,9 @@ /// delete the last object that creates isl objects with the context. std::shared_ptr IslCtx; - /// A map from basic blocks to SCoP statements. - DenseMap StmtMap; + /// A map from basic blocks to vector of SCoP statements. Currently this + /// vector comprises only of a single statement. + DenseMap> StmtMap; /// A map from basic blocks to their domains. DenseMap DomainMap; Index: polly/trunk/lib/Analysis/ScopInfo.cpp =================================================================== --- polly/trunk/lib/Analysis/ScopInfo.cpp +++ polly/trunk/lib/Analysis/ScopInfo.cpp @@ -4748,7 +4748,7 @@ 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 @@ 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 @@ 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 {