[Polly][Isl] Use isl::union_set::unite() instead of isl::union_set::add_set(). NFC
authorpatacca <patacca@autistici.org>
Wed, 7 Jul 2021 14:26:44 +0000 (16:26 +0200)
committerpatacca <patacca@autistici.org>
Wed, 7 Jul 2021 14:26:55 +0000 (16:26 +0200)
This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Use `isl::union_set::unite()` instead of `isl::union_set::add_set()`
 - `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/390c44982b5cee7eb43f8f7a80e185e6d21466b2

Depends on D104994

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D105444

polly/lib/Analysis/DependenceInfo.cpp
polly/lib/External/isl/include/isl/isl-noexceptions.h
polly/lib/Support/ISLTools.cpp
polly/lib/Transform/DeLICM.cpp
polly/lib/Transform/MaximalStaticExpansion.cpp
polly/lib/Transform/ZoneAlgo.cpp
polly/unittests/DeLICM/DeLICMTest.cpp

index 5f4c293..fc3c7a4 100644 (file)
@@ -192,7 +192,7 @@ static void collectInfo(Scop &S, isl_union_map *&Read,
 static void fixSetToZero(isl::set Zero, isl::union_set *User) {
   for (auto i : seq<isl_size>(0, Zero.tuple_dim()))
     Zero = Zero.fix_si(isl::dim::set, i, 0);
-  *User = User->add_set(Zero);
+  *User = User->unite(Zero);
 }
 
 /// Compute the privatization dependences for a given dependency @p Map
index facb764..d00bc83 100644 (file)
@@ -3699,7 +3699,6 @@ public:
   inline ctx get_ctx() const;
   inline void dump() const;
 
-  inline union_set add_set(set set) const;
   inline union_set affine_hull() const;
   inline union_set align_params(space model) const;
   inline union_set apply(union_map umap) const;
@@ -19740,12 +19739,6 @@ void union_set::dump() const {
 }
 
 
-union_set union_set::add_set(set set) const
-{
-  auto res = isl_union_set_add_set(copy(), set.release());
-  return manage(res);
-}
-
 union_set union_set::affine_hull() const
 {
   auto res = isl_union_set_affine_hull(copy());
index d772b71..ea66aae 100644 (file)
@@ -229,7 +229,7 @@ isl::union_set polly::shiftDim(isl::union_set USet, int Pos, int Amount) {
   isl::union_set Result = isl::union_set::empty(USet.get_space());
   for (isl::set Set : USet.get_set_list()) {
     isl::set Shifted = shiftDim(Set, Pos, Amount);
-    Result = Result.add_set(Shifted);
+    Result = Result.unite(Shifted);
   }
   return Result;
 }
@@ -827,7 +827,7 @@ static isl::union_set expand(const isl::union_set &USet) {
   isl::union_set Expanded = isl::union_set::empty(USet.get_space());
   for (isl::set Set : USet.get_set_list()) {
     isl::set SetExpanded = expand(Set);
-    Expanded = Expanded.add_set(SetExpanded);
+    Expanded = Expanded.unite(SetExpanded);
   }
   return Expanded;
 }
index 13b281a..d96d4b2 100644 (file)
@@ -624,7 +624,7 @@ private:
 
     // Find all uses.
     for (auto *MA : S->getValueUses(SAI))
-      Reads = Reads.add_set(getDomainFor(MA));
+      Reads = Reads.unite(getDomainFor(MA));
 
     // { DomainRead[] -> Scatter[] }
     auto ReadSchedule = getScatterFor(Reads);
@@ -885,7 +885,7 @@ private:
     auto UniverseWritesDom = isl::union_set::empty(ParamSpace);
 
     for (auto *MA : S->getPHIIncomings(SAI))
-      UniverseWritesDom = UniverseWritesDom.add_set(getDomainFor(MA));
+      UniverseWritesDom = UniverseWritesDom.unite(getDomainFor(MA));
 
     auto RelevantWritesTarget = WritesTarget;
     if (DelicmOverapproximateWrites)
index da2774b..21f7252 100644 (file)
@@ -189,7 +189,7 @@ bool MaximalStaticExpander::isExpandable(
     for (auto Write : Writes) {
       auto MapDeps = filterDependences(S, Dependences, Write);
       for (isl::map Map : MapDeps.get_map_list())
-        WriteDomain = WriteDomain.add_set(Map.range());
+        WriteDomain = WriteDomain.unite(Map.range());
     }
 
     // For now, read from original scalar is not possible.
index 2c9499d..71c453a 100644 (file)
@@ -336,7 +336,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
     // To avoid solving any ILP problems, always add entire arrays instead of
     // just the elements that are accessed.
     auto ArrayElts = isl::set::universe(AccRelMap.get_space().range());
-    AllElts = AllElts.add_set(ArrayElts);
+    AllElts = AllElts.unite(ArrayElts);
 
     if (MA->isRead()) {
       // Reject load after store to same location.
@@ -350,7 +350,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
         R << ", loading: " << AccRel << ")";
         S->getFunction().getContext().diagnose(R);
 
-        IncompatibleElts = IncompatibleElts.add_set(ArrayElts);
+        IncompatibleElts = IncompatibleElts.unite(ArrayElts);
       }
 
       Loads = Loads.unite(AccRel);
@@ -367,7 +367,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
       R << "store is in a non-affine subregion";
       S->getFunction().getContext().diagnose(R);
 
-      IncompatibleElts = IncompatibleElts.add_set(ArrayElts);
+      IncompatibleElts = IncompatibleElts.unite(ArrayElts);
     }
 
     // Do not allow more than one store to the same location.
@@ -380,7 +380,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
       R << ", storing: " << AccRel << ")";
       S->getFunction().getContext().diagnose(R);
 
-      IncompatibleElts = IncompatibleElts.add_set(ArrayElts);
+      IncompatibleElts = IncompatibleElts.unite(ArrayElts);
     }
 
     Stores = Stores.unite(AccRel);
index 64318a4..34a7306 100644 (file)
@@ -27,7 +27,7 @@ isl::union_set unionSpace(const isl::union_set &USet) {
   for (isl::set Set : USet.get_set_list()) {
     isl::space Space = Set.get_space();
     isl::set Universe = isl::set::universe(Space);
-    Result = Result.add_set(Universe);
+    Result = Result.unite(Universe);
   }
   return Result;
 }
@@ -120,7 +120,7 @@ bool checkIsConflictingNonsymmetricCommon(
   auto NewSpace = isl::space(Ctx, 0, 1);
   NewSpace = NewSpace.set_tuple_id(isl::dim::set, NewId);
   auto NewSet = isl::set::universe(NewSpace);
-  Universe = Universe.add_set(NewSet);
+  Universe = Universe.unite(NewSet);
 
   // Using the universe, fill missing data.
   isl::union_set ExistingOccupied;