[polly] r303507 - [Simplify] Move to isl C++

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun May 21 09:12:22 PDT 2017


Author: grosser
Date: Sun May 21 11:12:21 2017
New Revision: 303507

URL: http://llvm.org/viewvc/llvm-project?rev=303507&view=rev
Log:
[Simplify] Move to isl C++

Modified:
    polly/trunk/lib/Transform/Simplify.cpp

Modified: polly/trunk/lib/Transform/Simplify.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/Simplify.cpp?rev=303507&r1=303506&r2=303507&view=diff
==============================================================================
--- polly/trunk/lib/Transform/Simplify.cpp (original)
+++ polly/trunk/lib/Transform/Simplify.cpp Sun May 21 11:12:21 2017
@@ -131,7 +131,7 @@ private:
   ///         one element in @p Targets.
   MemoryAccess *hasWriteBetween(ScopStmt *Stmt, MemoryAccess *From,
                                 MemoryAccess *To, isl::map Targets) {
-    auto TargetsSpace = give(isl_map_get_space(Targets.keep()));
+    auto TargetsSpace = Targets.get_space();
 
     bool Started = Stmt->isRegionStmt();
     for (auto *Acc : *Stmt) {
@@ -154,18 +154,16 @@ private:
         continue;
 
       auto AccRel = give(Acc->getAccessRelation());
-      auto AccRelSpace = give(isl_map_get_space(AccRel.keep()));
+      auto AccRelSpace = AccRel.get_space();
 
       // Spaces being different means that they access different arrays.
-      if (isl_space_has_equal_tuples(TargetsSpace.keep(), AccRelSpace.keep()) ==
-          isl_bool_false)
+      if (!TargetsSpace.has_equal_tuples(AccRelSpace))
         continue;
 
-      AccRel = give(isl_map_intersect_domain(AccRel.take(),
-                                             Acc->getStatement()->getDomain()));
-      AccRel = give(isl_map_intersect_params(AccRel.take(), S->getContext()));
-      auto CommonElt = give(isl_map_intersect(Targets.copy(), AccRel.copy()));
-      if (isl_map_is_empty(CommonElt.keep()) != isl_bool_true)
+      AccRel = AccRel.intersect_domain(give(Acc->getStatement()->getDomain()));
+      AccRel = AccRel.intersect_params(give(S->getContext()));
+      auto CommonElt = Targets.intersect(AccRel);
+      if (!CommonElt.is_empty())
         return Acc;
     }
     assert(Stmt->isRegionStmt() &&
@@ -208,9 +206,7 @@ private:
 
         // If all of a write's elements are overwritten, remove it.
         isl::union_map AccRelUnion = AccRel;
-        if (isl_union_map_is_subset(AccRelUnion.keep(),
-                                    WillBeOverwritten.keep()) ==
-            isl_bool_true) {
+        if (AccRelUnion.is_subset(WillBeOverwritten)) {
           DEBUG(dbgs() << "Removing " << MA
                        << " which will be overwritten anyway\n");
 
@@ -252,15 +248,13 @@ private:
           continue;
 
         auto WARel = give(WA->getLatestAccessRelation());
-        WARel = give(isl_map_intersect_domain(WARel.take(),
-                                              WA->getStatement()->getDomain()));
-        WARel = give(isl_map_intersect_params(WARel.take(), S->getContext()));
+        WARel = WARel.intersect_domain(give(WA->getStatement()->getDomain()));
+        WARel = WARel.intersect_params(give(S->getContext()));
         auto RARel = give(RA->getLatestAccessRelation());
-        RARel = give(isl_map_intersect_domain(RARel.take(),
-                                              RA->getStatement()->getDomain()));
-        RARel = give(isl_map_intersect_params(RARel.take(), S->getContext()));
+        RARel = RARel.intersect_domain(give(RA->getStatement()->getDomain()));
+        RARel = RARel.intersect_params(give(S->getContext()));
 
-        if (isl_map_is_equal(RARel.keep(), WARel.keep()) != isl_bool_true) {
+        if (!RARel.is_equal(WARel)) {
           PairUnequalAccRels++;
           DEBUG(dbgs() << "Not cleaning up " << WA
                        << " because of unequal access relations:\n");




More information about the llvm-commits mailing list