[polly] b55aedd - [Polly][Isl] Use isl::union_set::unite() instead of isl::union_set::add_set(). NFC
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 7 07:27:05 PDT 2021
Author: patacca
Date: 2021-07-07T16:26:55+02:00
New Revision: b55aedd0b8cf6dbd6d3d08e1a9a40fd73eb6b2dc
URL: https://github.com/llvm/llvm-project/commit/b55aedd0b8cf6dbd6d3d08e1a9a40fd73eb6b2dc
DIFF: https://github.com/llvm/llvm-project/commit/b55aedd0b8cf6dbd6d3d08e1a9a40fd73eb6b2dc.diff
LOG: [Polly][Isl] Use isl::union_set::unite() instead of isl::union_set::add_set(). NFC
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
Added:
Modified:
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
Removed:
################################################################################
diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp
index 5f4c293c23e1a..fc3c7a4319b64 100644
--- a/polly/lib/Analysis/DependenceInfo.cpp
+++ b/polly/lib/Analysis/DependenceInfo.cpp
@@ -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
diff --git a/polly/lib/External/isl/include/isl/isl-noexceptions.h b/polly/lib/External/isl/include/isl/isl-noexceptions.h
index facb764e1d1ad..d00bc832d166d 100644
--- a/polly/lib/External/isl/include/isl/isl-noexceptions.h
+++ b/polly/lib/External/isl/include/isl/isl-noexceptions.h
@@ -3699,7 +3699,6 @@ class union_set {
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());
diff --git a/polly/lib/Support/ISLTools.cpp b/polly/lib/Support/ISLTools.cpp
index d772b71292c44..ea66aaed34c90 100644
--- a/polly/lib/Support/ISLTools.cpp
+++ b/polly/lib/Support/ISLTools.cpp
@@ -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;
}
diff --git a/polly/lib/Transform/DeLICM.cpp b/polly/lib/Transform/DeLICM.cpp
index 13b281a2fd86a..d96d4b2028623 100644
--- a/polly/lib/Transform/DeLICM.cpp
+++ b/polly/lib/Transform/DeLICM.cpp
@@ -624,7 +624,7 @@ class DeLICMImpl : public ZoneAlgorithm {
// 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 @@ class DeLICMImpl : public ZoneAlgorithm {
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)
diff --git a/polly/lib/Transform/MaximalStaticExpansion.cpp b/polly/lib/Transform/MaximalStaticExpansion.cpp
index da2774b9357c0..21f72520fceb9 100644
--- a/polly/lib/Transform/MaximalStaticExpansion.cpp
+++ b/polly/lib/Transform/MaximalStaticExpansion.cpp
@@ -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.
diff --git a/polly/lib/Transform/ZoneAlgo.cpp b/polly/lib/Transform/ZoneAlgo.cpp
index 2c9499d959959..71c453a27ab1b 100644
--- a/polly/lib/Transform/ZoneAlgo.cpp
+++ b/polly/lib/Transform/ZoneAlgo.cpp
@@ -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);
diff --git a/polly/unittests/DeLICM/DeLICMTest.cpp b/polly/unittests/DeLICM/DeLICMTest.cpp
index 64318a4bc0d94..34a73064246a9 100644
--- a/polly/unittests/DeLICM/DeLICMTest.cpp
+++ b/polly/unittests/DeLICM/DeLICMTest.cpp
@@ -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;
More information about the llvm-commits
mailing list