[llvm-commits] [polly] r144226 - in /polly/trunk: include/polly/TempScopInfo.h lib/Analysis/ScopInfo.cpp lib/Analysis/TempScopInfo.cpp

Tobias Grosser grosser at fim.uni-passau.de
Wed Nov 9 14:34:44 PST 2011


Author: grosser
Date: Wed Nov  9 16:34:44 2011
New Revision: 144226

URL: http://llvm.org/viewvc/llvm-project?rev=144226&view=rev
Log:
Remove SCEVAffFunc from polly::Comparison

Modified:
    polly/trunk/include/polly/TempScopInfo.h
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/lib/Analysis/TempScopInfo.cpp

Modified: polly/trunk/include/polly/TempScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/TempScopInfo.h?rev=144226&r1=144225&r2=144226&view=diff
==============================================================================
--- polly/trunk/include/polly/TempScopInfo.h (original)
+++ polly/trunk/include/polly/TempScopInfo.h Wed Nov  9 16:34:44 2011
@@ -131,17 +131,17 @@
 
 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;

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=144226&r1=144225&r2=144226&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Wed Nov  9 16:34:44 2011
@@ -610,8 +610,8 @@
 }
 
 __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:

Modified: polly/trunk/lib/Analysis/TempScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/TempScopInfo.cpp?rev=144226&r1=144225&r2=144226&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/TempScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/TempScopInfo.cpp Wed Nov  9 16:34:44 2011
@@ -147,19 +147,16 @@
 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 @@
   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 @@
     break;
   }
 
-  *Comp = new Comparison(AffLHS, AffRHS, Pred);
+  *Comp = new Comparison(LHS, RHS, Pred);
 }
 
 void TempScopInfo::buildCondition(BasicBlock *BB, BasicBlock *RegionEntry,





More information about the llvm-commits mailing list