forked from OSchip/llvm-project
TempScop: Remove SCEVAffFunc from LoopBoundInfo
This is not needed anymore -> Reduce impact of SCEVAffFunc. llvm-svn: 143575
This commit is contained in:
parent
65fa78e975
commit
1179afafca
|
@ -167,7 +167,7 @@ typedef SmallVector<Comparison, 4> BBCond;
|
||||||
/// A canonical induction variable is:
|
/// A canonical induction variable is:
|
||||||
/// an integer recurrence that starts at 0 and increments by one each time
|
/// an integer recurrence that starts at 0 and increments by one each time
|
||||||
/// through the loop.
|
/// through the loop.
|
||||||
typedef std::map<const Loop*, SCEVAffFunc> LoopBoundMapType;
|
typedef std::map<const Loop*, const SCEV*> LoopBoundMapType;
|
||||||
|
|
||||||
/// Mapping BBs to its condition constrains
|
/// Mapping BBs to its condition constrains
|
||||||
typedef std::map<const BasicBlock*, BBCond> BBCondMapType;
|
typedef std::map<const BasicBlock*, BBCond> BBCondMapType;
|
||||||
|
@ -234,7 +234,7 @@ public:
|
||||||
///
|
///
|
||||||
/// @return The bounds of the loop L in { Lower bound, Upper bound } form.
|
/// @return The bounds of the loop L in { Lower bound, Upper bound } form.
|
||||||
///
|
///
|
||||||
const SCEVAffFunc &getLoopBound(const Loop *L) const {
|
const SCEV *getLoopBound(const Loop *L) const {
|
||||||
LoopBoundMapType::const_iterator at = LoopBounds.find(L);
|
LoopBoundMapType::const_iterator at = LoopBounds.find(L);
|
||||||
assert(at != LoopBounds.end() && "Only valid loop is allow!");
|
assert(at != LoopBounds.end() && "Only valid loop is allow!");
|
||||||
return at->second;
|
return at->second;
|
||||||
|
|
|
@ -639,7 +639,7 @@ __isl_give isl_set *ScopStmt::addLoopBoundsToDomain(__isl_take isl_set *Domain,
|
||||||
|
|
||||||
// IV <= LatchExecutions.
|
// IV <= LatchExecutions.
|
||||||
const Loop *L = getLoopForDimension(i);
|
const Loop *L = getLoopForDimension(i);
|
||||||
const SCEV *LatchExecutions = tempScop.getLoopBound(L).OriginalSCEV;
|
const SCEV *LatchExecutions = tempScop.getLoopBound(L);
|
||||||
isl_pw_aff *UpperBound = SCEVAffinator::getPwAff(this, LatchExecutions);
|
isl_pw_aff *UpperBound = SCEVAffinator::getPwAff(this, LatchExecutions);
|
||||||
isl_set *UpperBoundSet = isl_pw_aff_le_set(IV, UpperBound);
|
isl_set *UpperBoundSet = isl_pw_aff_le_set(IV, UpperBound);
|
||||||
Domain = isl_set_intersect(Domain, UpperBoundSet);
|
Domain = isl_set_intersect(Domain, UpperBoundSet);
|
||||||
|
|
|
@ -156,7 +156,7 @@ void TempScop::printDetail(llvm::raw_ostream &OS, ScalarEvolution *SE,
|
||||||
if (at != LoopBounds.end()) {
|
if (at != LoopBounds.end()) {
|
||||||
OS.indent(ind) << "Bounds of Loop: " << at->first->getHeader()->getName()
|
OS.indent(ind) << "Bounds of Loop: " << at->first->getHeader()->getName()
|
||||||
<< ":\t{ ";
|
<< ":\t{ ";
|
||||||
OS << *(at->second.OriginalSCEV);
|
OS << *(at->second);
|
||||||
OS << " }\n";
|
OS << " }\n";
|
||||||
ind += 2;
|
ind += 2;
|
||||||
}
|
}
|
||||||
|
@ -279,9 +279,14 @@ void TempScopInfo::buildLoopBounds(TempScop &Scop) {
|
||||||
if (LoopBounds.find(L) != LoopBounds.end())
|
if (LoopBounds.find(L) != LoopBounds.end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const SCEV *LoopCount = SE->getBackedgeTakenCount(L);
|
const SCEV *BackedgeTakenCount = SE->getBackedgeTakenCount(L);
|
||||||
LoopBounds[L] = SCEVAffFunc(SCEVAffFunc::Eq, LoopCount);
|
LoopBounds[L] = BackedgeTakenCount;
|
||||||
buildAffineFunction(LoopCount, LoopBounds[L], Scop.getMaxRegion(),
|
|
||||||
|
// FIXME: Do not build TempSCEVAffFunc. It is not needed anywhere else
|
||||||
|
// and only build to register the parameters in this SCoP. We should
|
||||||
|
// move this functionality to the ScopDetection.
|
||||||
|
SCEVAffFunc Temp(SCEVAffFunc::Eq, BackedgeTakenCount);
|
||||||
|
buildAffineFunction(BackedgeTakenCount, Temp, Scop.getMaxRegion(),
|
||||||
Scop.getParamSet());
|
Scop.getParamSet());
|
||||||
|
|
||||||
Loop *OL = R.outermostLoopInRegion(L);
|
Loop *OL = R.outermostLoopInRegion(L);
|
||||||
|
|
Loading…
Reference in New Issue