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

Tobias Grosser grosser at fim.uni-passau.de
Sun Oct 23 13:59:21 PDT 2011


Author: grosser
Date: Sun Oct 23 15:59:20 2011
New Revision: 142768

URL: http://llvm.org/viewvc/llvm-project?rev=142768&view=rev
Log:
ScopInfo: Remove unneeded code

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

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=142768&r1=142767&r2=142768&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Oct 23 15:59:20 2011
@@ -255,8 +255,7 @@
 
   /// Build the statment.
   //@{
-  __isl_give isl_set *buildConditionSet(const Comparison &Cmp,
-                                        __isl_take isl_space *Space) const;
+  __isl_give isl_set *buildConditionSet(const Comparison &Cmp) const;
   __isl_give isl_set *addConditionsToDomain(__isl_take isl_set *Domain,
                                             TempScop &tempScop,
                                             const Region &CurRegion) const;
@@ -280,7 +279,6 @@
 public:
 
   ~ScopStmt();
-
   /// @brief Get an isl_ctx pointer.
   isl_ctx *getIslCtx() const;
 

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=142768&r1=142767&r2=142768&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Oct 23 15:59:20 2011
@@ -592,36 +592,24 @@
   }
 }
 
-__isl_give isl_set *ScopStmt::buildConditionSet(const Comparison &Comp,
-                                                __isl_take isl_space *Space)
-  const {
-
-  isl_pw_aff *LHS = SCEVAffinator::getPwAff(this, Comp.getLHS()->OriginalSCEV,
-                                            0);
-  isl_pw_aff *RHS = SCEVAffinator::getPwAff(this, Comp.getRHS()->OriginalSCEV,
-                                            0);
+__isl_give isl_set *ScopStmt::buildConditionSet(const Comparison &Comp) const {
 
-  isl_set *Set;
+  isl_pw_aff *L = SCEVAffinator::getPwAff(this, Comp.getLHS()->OriginalSCEV, 0);
+  isl_pw_aff *R = SCEVAffinator::getPwAff(this, Comp.getRHS()->OriginalSCEV, 0);
 
   switch (Comp.getPred()) {
   case ICmpInst::ICMP_EQ:
-    Set = isl_pw_aff_eq_set(LHS, RHS);
-    break;
+    return isl_pw_aff_eq_set(L, R);
   case ICmpInst::ICMP_NE:
-    Set = isl_pw_aff_ne_set(LHS, RHS);
-    break;
+    return isl_pw_aff_ne_set(L, R);
   case ICmpInst::ICMP_SLT:
-    Set = isl_pw_aff_lt_set(LHS, RHS);
-    break;
+    return isl_pw_aff_lt_set(L, R);
   case ICmpInst::ICMP_SLE:
-    Set = isl_pw_aff_le_set(LHS, RHS);
-    break;
+    return isl_pw_aff_le_set(L, R);
   case ICmpInst::ICMP_SGT:
-    Set = isl_pw_aff_gt_set(LHS, RHS);
-    break;
+    return isl_pw_aff_gt_set(L, R);
   case ICmpInst::ICMP_SGE:
-    Set = isl_pw_aff_ge_set(LHS, RHS);
-    break;
+    return isl_pw_aff_ge_set(L, R);
   case ICmpInst::ICMP_ULT:
   case ICmpInst::ICMP_UGT:
   case ICmpInst::ICMP_ULE:
@@ -630,8 +618,6 @@
   default:
     llvm_unreachable("Non integer predicate not supported");
   }
-
-  return Set;
 }
 
 __isl_give isl_set *ScopStmt::addLoopBoundsToDomain(__isl_take isl_set *Domain,
@@ -667,7 +653,6 @@
                                                     TempScop &tempScop,
                                                     const Region &CurRegion)
   const {
-  isl_space *Space = isl_set_get_space(Domain);
   const Region *TopRegion = tempScop.getMaxRegion().getParent(),
                *CurrentRegion = &CurRegion;
   const BasicBlock *BranchingBB = BB;
@@ -677,7 +662,7 @@
       if (const BBCond *Condition = tempScop.getBBCond(BranchingBB))
         for (BBCond::const_iterator CI = Condition->begin(),
              CE = Condition->end(); CI != CE; ++CI) {
-          isl_set *ConditionSet = buildConditionSet(*CI, Space);
+          isl_set *ConditionSet = buildConditionSet(*CI);
           Domain = isl_set_intersect(Domain, ConditionSet);
         }
     }
@@ -685,8 +670,6 @@
     CurrentRegion = CurrentRegion->getParent();
   } while (TopRegion != CurrentRegion);
 
-  isl_space_free(Space);
-
   return Domain;
 }
 





More information about the llvm-commits mailing list