[ScopBuilder/ScopInfo] Move ScopStmt::buildDomain to ScopBuilder. NFC.

This method is only called in the SCoP building phase.
Therefore it fits better into ScopBuilder to separate
SCoP-construction from SCoP modeling.

llvm-svn: 312116
This commit is contained in:
Michael Kruse 2017-08-30 13:04:54 +00:00
parent a29f8c03d4
commit eb83141f9e
4 changed files with 11 additions and 10 deletions

View File

@ -335,6 +335,9 @@ class ScopBuilder {
/// @see MemoryKind
void addPHIReadAccess(ScopStmt *PHIStmt, PHINode *PHI);
/// Build the domain of @p Stmt.
void buildDomain(ScopStmt &Stmt);
/// Build the access relation of all memory accesses of @p Stmt.
void buildAccessRelations(ScopStmt &Stmt);

View File

@ -1309,9 +1309,7 @@ private:
/// Vector for Instructions in this statement.
std::vector<Instruction *> Instructions;
/// Build the statement.
//@{
void buildDomain();
/// Fill NestLoops with loops surrounding this statement.
void collectSurroundingLoops();

View File

@ -911,6 +911,13 @@ void ScopBuilder::addPHIReadAccess(ScopStmt *PHIStmt, PHINode *PHI) {
MemoryKind::PHI);
}
void ScopBuilder::buildDomain(ScopStmt &Stmt) {
isl::id Id = isl::id::alloc(scop->getIslCtx(), Stmt.getBaseName(), &Stmt);
Stmt.Domain = scop->getDomainConditions(&Stmt);
Stmt.Domain = Stmt.Domain.set_tuple_id(Id);
}
void ScopBuilder::buildAccessRelations(ScopStmt &Stmt) {
for (MemoryAccess *Access : Stmt.MemAccs) {
Type *ElementType = Access->getElementType();
@ -1069,7 +1076,7 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC,
// The ScopStmts now have enough information to initialize themselves.
for (ScopStmt &Stmt : *scop) {
Stmt.buildDomain();
buildDomain(Stmt);
Stmt.collectSurroundingLoops();
buildAccessRelations(Stmt);

View File

@ -1715,13 +1715,6 @@ buildConditionSets(Scop &S, BasicBlock *BB, TerminatorInst *TI, Loop *L,
ConditionSets);
}
void ScopStmt::buildDomain() {
isl::id Id = isl::id::alloc(getIslCtx(), getBaseName(), this);
Domain = getParent()->getDomainConditions(this);
Domain = Domain.set_tuple_id(Id);
}
void ScopStmt::collectSurroundingLoops() {
for (unsigned u = 0, e = Domain.dim(isl::dim::set); u < e; u++) {
isl::id DimId = Domain.get_dim_id(isl::dim::set, u);