diff --git a/polly/include/polly/ScopInfo.h b/polly/include/polly/ScopInfo.h index fd5c81264446..a939b15f7d3b 100644 --- a/polly/include/polly/ScopInfo.h +++ b/polly/include/polly/ScopInfo.h @@ -589,11 +589,11 @@ public: const ScopStmt &operator=(const ScopStmt &) = delete; /// Create the ScopStmt from a BasicBlock. - ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, - BasicBlock &bb, SmallVectorImpl &NestLoops); + ScopStmt(Scop &parent, TempScop &tempScop, BasicBlock &bb, + SmallVectorImpl &NestLoops); /// Create an overapproximating ScopStmt for the region @p R. - ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, Region &R, + ScopStmt(Scop &parent, TempScop &tempScop, Region &R, SmallVectorImpl &NestLoops); private: @@ -659,7 +659,7 @@ private: /// Build the statement. //@{ - void buildDomain(TempScop &tempScop, const Region &CurRegion); + void buildDomain(); /// @brief Create the accesses for instructions in @p Block. /// @@ -1084,10 +1084,8 @@ private: /// @param BB The basic block we build the statement for (or null) /// @param R The region we build the statement for (or null). /// @param tempScop The temp SCoP we use as model. - /// @param CurRegion The SCoP region. /// @param NestLoops A vector of all surrounding loops. ScopStmt *addScopStmt(BasicBlock *BB, Region *R, TempScop &tempScop, - const Region &CurRegion, SmallVectorImpl &NestLoops); /// @brief Create the ScopStmt for a BasicBlock and return its schedule. @@ -1096,12 +1094,10 @@ private: /// /// @param BB The basic block we build the statement for. /// @param tempScop The temp SCoP we use as model. - /// @param CurRegion The SCoP region. /// @param NestLoops A vector of all surrounding loops. /// /// @return The ScopStmt's schedule. __isl_give isl_schedule *buildBBScopStmt(BasicBlock *BB, TempScop &tempScop, - const Region &CurRegion, SmallVectorImpl &NestLoops); /// @brief Build Scop and ScopStmts from a given TempScop. diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index e27026fb18eb..7fc28e57574d 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -903,7 +903,7 @@ buildConditionSets(Scop &S, BranchInst *BI, Loop *L, __isl_keep isl_set *Domain, isl_set_intersect(AlternativeCondSet, isl_set_copy(Domain)))); } -void ScopStmt::buildDomain(TempScop &tempScop, const Region &CurRegion) { +void ScopStmt::buildDomain() { isl_id *Id; Id = isl_id_alloc(getIslCtx(), getBaseName(), this); @@ -968,8 +968,8 @@ void ScopStmt::deriveAssumptions(BasicBlock *Block) { deriveAssumptionsFromGEP(GEP); } -ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, - Region &R, SmallVectorImpl &Nest) +ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, Region &R, + SmallVectorImpl &Nest) : Parent(parent), BB(nullptr), R(&R), Build(nullptr), NestLoops(Nest.size()) { // Setup the induction variables. @@ -978,7 +978,7 @@ ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, BaseName = getIslCompatibleName("Stmt_", R.getNameStr(), ""); - buildDomain(tempScop, CurRegion); + buildDomain(); BasicBlock *EntryBB = R.getEntry(); for (BasicBlock *Block : R.blocks()) { @@ -989,8 +989,8 @@ ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, checkForReductions(); } -ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, - BasicBlock &bb, SmallVectorImpl &Nest) +ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, BasicBlock &bb, + SmallVectorImpl &Nest) : Parent(parent), BB(&bb), R(nullptr), Build(nullptr), NestLoops(Nest.size()) { // Setup the induction variables. @@ -999,7 +999,7 @@ ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion, BaseName = getIslCompatibleName("Stmt_", &bb, ""); - buildDomain(tempScop, CurRegion); + buildDomain(); buildAccesses(tempScop, BB); deriveAssumptions(BB); if (DetectReductions) @@ -2449,16 +2449,15 @@ mapToDimension(__isl_take isl_union_set *Domain, int N) { } ScopStmt *Scop::addScopStmt(BasicBlock *BB, Region *R, TempScop &tempScop, - const Region &CurRegion, SmallVectorImpl &NestLoops) { ScopStmt *Stmt; if (BB) { - Stmts.emplace_back(*this, tempScop, CurRegion, *BB, NestLoops); + Stmts.emplace_back(*this, tempScop, *BB, NestLoops); Stmt = &Stmts.back(); StmtMap[BB] = Stmt; } else { assert(R && "Either basic block or a region expected."); - Stmts.emplace_back(*this, tempScop, CurRegion, *R, NestLoops); + Stmts.emplace_back(*this, tempScop, *R, NestLoops); Stmt = &Stmts.back(); for (BasicBlock *BB : R->blocks()) StmtMap[BB] = Stmt; @@ -2468,12 +2467,11 @@ ScopStmt *Scop::addScopStmt(BasicBlock *BB, Region *R, TempScop &tempScop, __isl_give isl_schedule * Scop::buildBBScopStmt(BasicBlock *BB, TempScop &tempScop, - const Region &CurRegion, SmallVectorImpl &NestLoops) { if (isTrivialBB(BB, tempScop)) return nullptr; - auto *Stmt = addScopStmt(BB, nullptr, tempScop, CurRegion, NestLoops); + auto *Stmt = addScopStmt(BB, nullptr, tempScop, NestLoops); auto *Domain = Stmt->getDomain(); return isl_schedule_from_domain(isl_union_set_from_set(Domain)); } @@ -2484,7 +2482,7 @@ __isl_give isl_schedule *Scop::buildScop(TempScop &tempScop, LoopInfo &LI, ScopDetection &SD) { if (SD.isNonAffineSubRegion(&CurRegion, &getRegion())) { auto *Stmt = addScopStmt(nullptr, const_cast(&CurRegion), - tempScop, CurRegion, NestLoops); + tempScop, NestLoops); auto *Domain = Stmt->getDomain(); return isl_schedule_from_domain(isl_union_set_from_set(Domain)); } @@ -2505,8 +2503,8 @@ __isl_give isl_schedule *Scop::buildScop(TempScop &tempScop, StmtSchedule = buildScop(tempScop, *I->getNodeAs(), NestLoops, LI, SD); } else { - StmtSchedule = buildBBScopStmt(I->getNodeAs(), tempScop, - CurRegion, NestLoops); + StmtSchedule = + buildBBScopStmt(I->getNodeAs(), tempScop, NestLoops); } Schedule = combineInSequence(Schedule, StmtSchedule); }