summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2011-11-09 22:34:44 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2011-11-09 22:34:44 +0000
commita601fbd6828259af7af4e3a2c0ef3df96b3efe48 (patch)
tree2cb335dd3c21d98e1b90a751538a539fe4ecfb07
parentfb47d66a066ab2a9bd94b8d383316a9e1335eba1 (diff)
downloadbcm5719-llvm-a601fbd6828259af7af4e3a2c0ef3df96b3efe48.tar.gz
bcm5719-llvm-a601fbd6828259af7af4e3a2c0ef3df96b3efe48.zip
Remove SCEVAffFunc from polly::Comparison
llvm-svn: 144226
-rwxr-xr-xpolly/include/polly/TempScopInfo.h12
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp4
-rw-r--r--polly/lib/Analysis/TempScopInfo.cpp20
3 files changed, 14 insertions, 22 deletions
diff --git a/polly/include/polly/TempScopInfo.h b/polly/include/polly/TempScopInfo.h
index cc37ecfaaad..702f8f5fb13 100755
--- a/polly/include/polly/TempScopInfo.h
+++ b/polly/include/polly/TempScopInfo.h
@@ -131,17 +131,17 @@ static inline raw_ostream& operator<<(raw_ostream &OS, const SCEVAffFunc &SAF){
class Comparison {
- SCEVAffFunc *LHS;
- SCEVAffFunc *RHS;
+ const SCEV *LHS;
+ const SCEV *RHS;
ICmpInst::Predicate Pred;
public:
- Comparison(SCEVAffFunc *lhs, SCEVAffFunc *rhs, ICmpInst::Predicate pred)
- : LHS(lhs), RHS(rhs), Pred(pred) {}
+ Comparison(const SCEV *LHS, const SCEV *RHS, ICmpInst::Predicate Pred)
+ : LHS(LHS), RHS(RHS), Pred(Pred) {}
- SCEVAffFunc *getLHS() const { return LHS; }
- SCEVAffFunc *getRHS() const { return RHS; }
+ const SCEV *getLHS() const { return LHS; }
+ const SCEV *getRHS() const { return RHS; }
ICmpInst::Predicate getPred() const { return Pred; }
void print(raw_ostream &OS) const;
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index cd6ba09f3ab..11c1dbb7f3f 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -610,8 +610,8 @@ void ScopStmt::realignParams() {
}
__isl_give isl_set *ScopStmt::buildConditionSet(const Comparison &Comp) {
- isl_pw_aff *L = SCEVAffinator::getPwAff(this, Comp.getLHS()->OriginalSCEV);
- isl_pw_aff *R = SCEVAffinator::getPwAff(this, Comp.getRHS()->OriginalSCEV);
+ isl_pw_aff *L = SCEVAffinator::getPwAff(this, Comp.getLHS());
+ isl_pw_aff *R = SCEVAffinator::getPwAff(this, Comp.getRHS());
switch (Comp.getPred()) {
case ICmpInst::ICMP_EQ:
diff --git a/polly/lib/Analysis/TempScopInfo.cpp b/polly/lib/Analysis/TempScopInfo.cpp
index afdaf487fb9..a3a71a5bf1a 100644
--- a/polly/lib/Analysis/TempScopInfo.cpp
+++ b/polly/lib/Analysis/TempScopInfo.cpp
@@ -147,19 +147,16 @@ void TempScopInfo::buildLoopBounds(TempScop &Scop) {
void TempScopInfo::buildAffineCondition(Value &V, bool inverted,
Comparison **Comp,
TempScop &Scop) const {
- Region &R = Scop.getMaxRegion();
- ParamSetType &Params = Scop.getParamSet();
if (ConstantInt *C = dyn_cast<ConstantInt>(&V)) {
// If this is always true condition, we will create 1 >= 0,
// otherwise we will create 1 == 0.
- SCEVAffFunc *AffLHS = new SCEVAffFunc(SE->getConstant(C->getType(), 0),
- SCEVAffFunc::Eq, R, Params, LI, SE);
- SCEVAffFunc *AffRHS = new SCEVAffFunc(SE->getConstant(C->getType(), 1),
- SCEVAffFunc::Eq, R, Params, LI, SE);
+ const SCEV *LHS = SE->getConstant(C->getType(), 0);
+ const SCEV *RHS = SE->getConstant(C->getType(), 1);
+
if (C->isOne() == inverted)
- *Comp = new Comparison(AffRHS, AffLHS, ICmpInst::ICMP_NE);
+ *Comp = new Comparison(RHS, LHS, ICmpInst::ICMP_NE);
else
- *Comp = new Comparison(AffLHS, AffLHS, ICmpInst::ICMP_EQ);
+ *Comp = new Comparison(LHS, LHS, ICmpInst::ICMP_EQ);
return;
}
@@ -176,11 +173,6 @@ void TempScopInfo::buildAffineCondition(Value &V, bool inverted,
if (inverted)
Pred = ICmpInst::getInversePredicate(Pred);
- SCEVAffFunc *AffLHS = new SCEVAffFunc(LHS, SCEVAffFunc::Eq, R, Params, LI,
- SE);
- SCEVAffFunc *AffRHS = new SCEVAffFunc(RHS, SCEVAffFunc::Eq, R, Params, LI,
- SE);
-
switch (Pred) {
case ICmpInst::ICMP_UGT:
case ICmpInst::ICMP_UGE:
@@ -195,7 +187,7 @@ void TempScopInfo::buildAffineCondition(Value &V, bool inverted,
break;
}
- *Comp = new Comparison(AffLHS, AffRHS, Pred);
+ *Comp = new Comparison(LHS, RHS, Pred);
}
void TempScopInfo::buildCondition(BasicBlock *BB, BasicBlock *RegionEntry,
OpenPOWER on IntegriCloud