[polly] r245179 - Build the ScopStmt domain in-place.

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 16 07:36:01 PDT 2015


Author: jdoerfert
Date: Sun Aug 16 09:36:01 2015
New Revision: 245179

URL: http://llvm.org/viewvc/llvm-project?rev=245179&view=rev
Log:
Build the ScopStmt domain in-place.

  This will build the statement domains in-place, hence using the
  ScopStmt::Domain member instead of some intermediate isl_set.

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

Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=245179&r1=245178&r2=245179&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Aug 16 09:36:01 2015
@@ -526,12 +526,9 @@ private:
   /// Build the statement.
   //@{
   __isl_give isl_set *buildConditionSet(const Comparison &Cmp);
-  __isl_give isl_set *addConditionsToDomain(__isl_take isl_set *Domain,
-                                            TempScop &tempScop,
-                                            const Region &CurRegion);
-  __isl_give isl_set *addLoopBoundsToDomain(__isl_take isl_set *Domain,
-                                            TempScop &tempScop);
-  __isl_give isl_set *buildDomain(TempScop &tempScop, const Region &CurRegion);
+  void addConditionsToDomain(TempScop &tempScop, const Region &CurRegion);
+  void addLoopBoundsToDomain(TempScop &tempScop);
+  void buildDomain(TempScop &tempScop, const Region &CurRegion);
 
   /// @brief Create the accesses for instructions in @p Block.
   ///

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=245179&r1=245178&r2=245179&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Aug 16 09:36:01 2015
@@ -743,8 +743,7 @@ __isl_give isl_set *ScopStmt::buildCondi
   }
 }
 
-__isl_give isl_set *ScopStmt::addLoopBoundsToDomain(__isl_take isl_set *Domain,
-                                                    TempScop &tempScop) {
+void ScopStmt::addLoopBoundsToDomain(TempScop &tempScop) {
   isl_space *Space;
   isl_local_space *LocalSpace;
 
@@ -770,12 +769,10 @@ __isl_give isl_set *ScopStmt::addLoopBou
   }
 
   isl_local_space_free(LocalSpace);
-  return Domain;
 }
 
-__isl_give isl_set *ScopStmt::addConditionsToDomain(__isl_take isl_set *Domain,
-                                                    TempScop &tempScop,
-                                                    const Region &CurRegion) {
+void ScopStmt::addConditionsToDomain(TempScop &tempScop,
+                                     const Region &CurRegion) {
   const Region *TopRegion = tempScop.getMaxRegion().getParent(),
                *CurrentRegion = &CurRegion;
   const BasicBlock *BranchingBB = BB ? BB : R->getEntry();
@@ -791,14 +788,10 @@ __isl_give isl_set *ScopStmt::addConditi
     BranchingBB = CurrentRegion->getEntry();
     CurrentRegion = CurrentRegion->getParent();
   } while (TopRegion != CurrentRegion);
-
-  return Domain;
 }
 
-__isl_give isl_set *ScopStmt::buildDomain(TempScop &tempScop,
-                                          const Region &CurRegion) {
+void ScopStmt::buildDomain(TempScop &tempScop, const Region &CurRegion) {
   isl_space *Space;
-  isl_set *Domain;
   isl_id *Id;
 
   Space = isl_space_set_alloc(getIslCtx(), 0, getNumIterators());
@@ -806,11 +799,9 @@ __isl_give isl_set *ScopStmt::buildDomai
   Id = isl_id_alloc(getIslCtx(), getBaseName(), this);
 
   Domain = isl_set_universe(Space);
-  Domain = addLoopBoundsToDomain(Domain, tempScop);
-  Domain = addConditionsToDomain(Domain, tempScop, CurRegion);
+  addLoopBoundsToDomain(tempScop);
+  addConditionsToDomain(tempScop, CurRegion);
   Domain = isl_set_set_tuple_id(Domain, Id);
-
-  return Domain;
 }
 
 void ScopStmt::deriveAssumptionsFromGEP(GetElementPtrInst *GEP) {
@@ -878,7 +869,7 @@ ScopStmt::ScopStmt(Scop &parent, TempSco
 
   BaseName = getIslCompatibleName("Stmt_", R.getNameStr(), "");
 
-  Domain = buildDomain(tempScop, CurRegion);
+  buildDomain(tempScop, CurRegion);
 
   BasicBlock *EntryBB = R.getEntry();
   for (BasicBlock *Block : R.blocks()) {
@@ -898,7 +889,7 @@ ScopStmt::ScopStmt(Scop &parent, TempSco
 
   BaseName = getIslCompatibleName("Stmt_", &bb, "");
 
-  Domain = buildDomain(tempScop, CurRegion);
+  buildDomain(tempScop, CurRegion);
   buildAccesses(tempScop, BB);
   deriveAssumptions(BB);
   checkForReductions();

Modified: polly/trunk/test/ScopInfo/user_context.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/user_context.ll?rev=245179&r1=245178&r2=245179&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/user_context.ll (original)
+++ polly/trunk/test/ScopInfo/user_context.ll Sun Aug 16 09:36:01 2015
@@ -10,7 +10,11 @@
 ; }
 
 ; CHECK: Context:
-; CHECK:    [N] -> {  : N >= -9223372036854775808 and N <= 9223372036854775807 }
+; CHECK:    [N] -> {  :
+; CHECK-DAG:     N >= -9223372036854775808
+; CHECK-DAG:   and
+; CHECK-DAG:     N <= 9223372036854775807
+; CHECK:           }
 
 ; CTX: Context:
 ; CTX:    [N] -> {  : N = 1024 }




More information about the llvm-commits mailing list