/// @return The representing SCEV for invariant loads or @p S if none.
const SCEV *getRepresentingInvariantLoadSCEV(const SCEV *S);
- /// Create a new SCoP statement for either @p BB or @p R.
+ /// Create a new SCoP statement for either @p BB.
///
- /// Either @p BB or @p R should be non-null. A new statement for the non-null
- /// argument will be created and added to the statement vector and map.
+ /// A new statement for @p BB will be created and added to the statement vector
+ /// and map.
///
- /// @param BB The basic block we build the statement for (or null)
- /// @param R The region we build the statement for (or null).
- void addScopStmt(BasicBlock *BB, Region *R);
+ /// @param BB The basic block we build the statement for.
+ void addScopStmt(BasicBlock *BB);
+
+ /// Create a new SCoP statement for either @p R.
+ ///
+ /// A new statement for @p R will be created and added to the statement vector
+ /// and map.
+ ///
+ /// @param R The region we build the statement for.
+ void addScopStmt(Region *R);
/// @param Update access dimensionalities.
///
void ScopBuilder::buildStmts(Region &SR) {
if (scop->isNonAffineSubRegion(&SR)) {
- scop->addScopStmt(nullptr, &SR);
+ scop->addScopStmt(&SR);
return;
}
if (I->isSubRegion())
buildStmts(*I->getNodeAs<Region>());
else
- scop->addScopStmt(I->getNodeAs<BasicBlock>(), nullptr);
+ scop->addScopStmt(I->getNodeAs<BasicBlock>());
}
void ScopBuilder::buildAccessFunctions(BasicBlock &BB,
return isl_multi_union_pw_aff_from_union_pw_multi_aff(Data.Res);
}
-void Scop::addScopStmt(BasicBlock *BB, Region *R) {
- if (BB) {
- Stmts.emplace_back(*this, *BB);
- auto *Stmt = &Stmts.back();
+void Scop::addScopStmt(BasicBlock *BB) {
+ assert(BB && "Unexpected nullptr!");
+ Stmts.emplace_back(*this, *BB);
+ auto *Stmt = &Stmts.back();
+ StmtMap[BB] = Stmt;
+}
+
+void Scop::addScopStmt(Region *R) {
+ assert(R && "Unexpected nullptr!");
+ Stmts.emplace_back(*this, *R);
+ auto *Stmt = &Stmts.back();
+ for (BasicBlock *BB : R->blocks())
StmtMap[BB] = Stmt;
- } else {
- assert(R && "Either basic block or a region expected.");
- Stmts.emplace_back(*this, *R);
- auto *Stmt = &Stmts.back();
- for (BasicBlock *BB : R->blocks())
- StmtMap[BB] = Stmt;
- }
}
ScopStmt *Scop::addScopStmt(__isl_take isl_map *SourceRel,