[llvm-commits] [polly] r144222 - /polly/trunk/lib/Analysis/ScopInfo.cpp

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


Author: grosser
Date: Wed Nov  9 16:34:28 2011
New Revision: 144222

URL: http://llvm.org/viewvc/llvm-project?rev=144222&view=rev
Log:
ScopInfo: Use getParamsInAffineExpr to get the BaseAddress

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

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=144222&r1=144221&r2=144222&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Wed Nov  9 16:34:28 2011
@@ -82,18 +82,19 @@
 
 public:
   static isl_pw_aff *getPwAff(ScopStmt *stmt, const SCEV *scev,
-                              const Value *baseAddress = 0) {
+                              bool isMemoryAccess = false) {
     Scop *S = stmt->getParent();
     const Region *Reg = &S->getRegion();
 
-    if (baseAddress) {
-      Value *Base;
-      S->addParams(getParamsInAffineExpr(Reg, scev, *S->getSE(), &Base));
+    Value *BaseAddress = NULL;
+
+    if (isMemoryAccess) {
+      S->addParams(getParamsInAffineExpr(Reg, scev, *S->getSE(), &BaseAddress));
     } else {
       S->addParams(getParamsInAffineExpr(Reg, scev, *S->getSE()));
     }
 
-    SCEVAffinator Affinator(stmt, baseAddress);
+    SCEVAffinator Affinator(stmt,  BaseAddress);
     return Affinator.visit(scev);
   }
 
@@ -333,7 +334,7 @@
   setBaseName();
 
   isl_pw_aff *Affine = SCEVAffinator::getPwAff(Statement, AffFunc.OriginalSCEV,
-                                               AffFunc.getBaseAddr());
+                                               true);
 
   // Devide the access function by the size of the elements in the array.
   //
@@ -609,8 +610,8 @@
 }
 
 __isl_give isl_set *ScopStmt::buildConditionSet(const Comparison &Comp) {
-  isl_pw_aff *L = SCEVAffinator::getPwAff(this, Comp.getLHS()->OriginalSCEV, 0);
-  isl_pw_aff *R = SCEVAffinator::getPwAff(this, Comp.getRHS()->OriginalSCEV, 0);
+  isl_pw_aff *L = SCEVAffinator::getPwAff(this, Comp.getLHS()->OriginalSCEV);
+  isl_pw_aff *R = SCEVAffinator::getPwAff(this, Comp.getRHS()->OriginalSCEV);
 
   switch (Comp.getPred()) {
   case ICmpInst::ICMP_EQ:





More information about the llvm-commits mailing list