forked from OSchip/llvm-project
Build the ScopStmt domain in-place.
This will build the statement domains in-place, hence using the ScopStmt::Domain member instead of some intermediate isl_set. llvm-svn: 245179
This commit is contained in:
parent
c594dc9ed0
commit
45545ff782
|
@ -526,12 +526,9 @@ private:
|
|||
/// Build the statement.
|
||||
//@{
|
||||
__isl_give isl_set *buildConditionSet(const Comparison &Cmp);
|
||||
__isl_give isl_set *addConditionsToDomain(__isl_take isl_set *Domain,
|
||||
TempScop &tempScop,
|
||||
const Region &CurRegion);
|
||||
__isl_give isl_set *addLoopBoundsToDomain(__isl_take isl_set *Domain,
|
||||
TempScop &tempScop);
|
||||
__isl_give isl_set *buildDomain(TempScop &tempScop, const Region &CurRegion);
|
||||
void addConditionsToDomain(TempScop &tempScop, const Region &CurRegion);
|
||||
void addLoopBoundsToDomain(TempScop &tempScop);
|
||||
void buildDomain(TempScop &tempScop, const Region &CurRegion);
|
||||
|
||||
/// @brief Create the accesses for instructions in @p Block.
|
||||
///
|
||||
|
|
|
@ -743,8 +743,7 @@ __isl_give isl_set *ScopStmt::buildConditionSet(const Comparison &Comp) {
|
|||
}
|
||||
}
|
||||
|
||||
__isl_give isl_set *ScopStmt::addLoopBoundsToDomain(__isl_take isl_set *Domain,
|
||||
TempScop &tempScop) {
|
||||
void ScopStmt::addLoopBoundsToDomain(TempScop &tempScop) {
|
||||
isl_space *Space;
|
||||
isl_local_space *LocalSpace;
|
||||
|
||||
|
@ -770,12 +769,10 @@ __isl_give isl_set *ScopStmt::addLoopBoundsToDomain(__isl_take isl_set *Domain,
|
|||
}
|
||||
|
||||
isl_local_space_free(LocalSpace);
|
||||
return Domain;
|
||||
}
|
||||
|
||||
__isl_give isl_set *ScopStmt::addConditionsToDomain(__isl_take isl_set *Domain,
|
||||
TempScop &tempScop,
|
||||
const Region &CurRegion) {
|
||||
void ScopStmt::addConditionsToDomain(TempScop &tempScop,
|
||||
const Region &CurRegion) {
|
||||
const Region *TopRegion = tempScop.getMaxRegion().getParent(),
|
||||
*CurrentRegion = &CurRegion;
|
||||
const BasicBlock *BranchingBB = BB ? BB : R->getEntry();
|
||||
|
@ -791,14 +788,10 @@ __isl_give isl_set *ScopStmt::addConditionsToDomain(__isl_take isl_set *Domain,
|
|||
BranchingBB = CurrentRegion->getEntry();
|
||||
CurrentRegion = CurrentRegion->getParent();
|
||||
} while (TopRegion != CurrentRegion);
|
||||
|
||||
return Domain;
|
||||
}
|
||||
|
||||
__isl_give isl_set *ScopStmt::buildDomain(TempScop &tempScop,
|
||||
const Region &CurRegion) {
|
||||
void ScopStmt::buildDomain(TempScop &tempScop, const Region &CurRegion) {
|
||||
isl_space *Space;
|
||||
isl_set *Domain;
|
||||
isl_id *Id;
|
||||
|
||||
Space = isl_space_set_alloc(getIslCtx(), 0, getNumIterators());
|
||||
|
@ -806,11 +799,9 @@ __isl_give isl_set *ScopStmt::buildDomain(TempScop &tempScop,
|
|||
Id = isl_id_alloc(getIslCtx(), getBaseName(), this);
|
||||
|
||||
Domain = isl_set_universe(Space);
|
||||
Domain = addLoopBoundsToDomain(Domain, tempScop);
|
||||
Domain = addConditionsToDomain(Domain, tempScop, CurRegion);
|
||||
addLoopBoundsToDomain(tempScop);
|
||||
addConditionsToDomain(tempScop, CurRegion);
|
||||
Domain = isl_set_set_tuple_id(Domain, Id);
|
||||
|
||||
return Domain;
|
||||
}
|
||||
|
||||
void ScopStmt::deriveAssumptionsFromGEP(GetElementPtrInst *GEP) {
|
||||
|
@ -878,7 +869,7 @@ ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion,
|
|||
|
||||
BaseName = getIslCompatibleName("Stmt_", R.getNameStr(), "");
|
||||
|
||||
Domain = buildDomain(tempScop, CurRegion);
|
||||
buildDomain(tempScop, CurRegion);
|
||||
|
||||
BasicBlock *EntryBB = R.getEntry();
|
||||
for (BasicBlock *Block : R.blocks()) {
|
||||
|
@ -898,7 +889,7 @@ ScopStmt::ScopStmt(Scop &parent, TempScop &tempScop, const Region &CurRegion,
|
|||
|
||||
BaseName = getIslCompatibleName("Stmt_", &bb, "");
|
||||
|
||||
Domain = buildDomain(tempScop, CurRegion);
|
||||
buildDomain(tempScop, CurRegion);
|
||||
buildAccesses(tempScop, BB);
|
||||
deriveAssumptions(BB);
|
||||
checkForReductions();
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
; }
|
||||
|
||||
; CHECK: Context:
|
||||
; CHECK: [N] -> { : N >= -9223372036854775808 and N <= 9223372036854775807 }
|
||||
; CHECK: [N] -> { :
|
||||
; CHECK-DAG: N >= -9223372036854775808
|
||||
; CHECK-DAG: and
|
||||
; CHECK-DAG: N <= 9223372036854775807
|
||||
; CHECK: }
|
||||
|
||||
; CTX: Context:
|
||||
; CTX: [N] -> { : N = 1024 }
|
||||
|
|
Loading…
Reference in New Issue