Skip to content

Commit b55aedd

Browse files
committed
[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 patacca/isl@390c449 Depends on D104994 Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D105444
1 parent 2c03d92 commit b55aedd

File tree

7 files changed

+12
-19
lines changed

7 files changed

+12
-19
lines changed

polly/lib/Analysis/DependenceInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static void collectInfo(Scop &S, isl_union_map *&Read,
192192
static void fixSetToZero(isl::set Zero, isl::union_set *User) {
193193
for (auto i : seq<isl_size>(0, Zero.tuple_dim()))
194194
Zero = Zero.fix_si(isl::dim::set, i, 0);
195-
*User = User->add_set(Zero);
195+
*User = User->unite(Zero);
196196
}
197197

198198
/// Compute the privatization dependences for a given dependency @p Map

polly/lib/External/isl/include/isl/isl-noexceptions.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3699,7 +3699,6 @@ class union_set {
36993699
inline ctx get_ctx() const;
37003700
inline void dump() const;
37013701

3702-
inline union_set add_set(set set) const;
37033702
inline union_set affine_hull() const;
37043703
inline union_set align_params(space model) const;
37053704
inline union_set apply(union_map umap) const;
@@ -19740,12 +19739,6 @@ void union_set::dump() const {
1974019739
}
1974119740

1974219741

19743-
union_set union_set::add_set(set set) const
19744-
{
19745-
auto res = isl_union_set_add_set(copy(), set.release());
19746-
return manage(res);
19747-
}
19748-
1974919742
union_set union_set::affine_hull() const
1975019743
{
1975119744
auto res = isl_union_set_affine_hull(copy());

polly/lib/Support/ISLTools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ isl::union_set polly::shiftDim(isl::union_set USet, int Pos, int Amount) {
229229
isl::union_set Result = isl::union_set::empty(USet.get_space());
230230
for (isl::set Set : USet.get_set_list()) {
231231
isl::set Shifted = shiftDim(Set, Pos, Amount);
232-
Result = Result.add_set(Shifted);
232+
Result = Result.unite(Shifted);
233233
}
234234
return Result;
235235
}
@@ -827,7 +827,7 @@ static isl::union_set expand(const isl::union_set &USet) {
827827
isl::union_set Expanded = isl::union_set::empty(USet.get_space());
828828
for (isl::set Set : USet.get_set_list()) {
829829
isl::set SetExpanded = expand(Set);
830-
Expanded = Expanded.add_set(SetExpanded);
830+
Expanded = Expanded.unite(SetExpanded);
831831
}
832832
return Expanded;
833833
}

polly/lib/Transform/DeLICM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class DeLICMImpl : public ZoneAlgorithm {
624624

625625
// Find all uses.
626626
for (auto *MA : S->getValueUses(SAI))
627-
Reads = Reads.add_set(getDomainFor(MA));
627+
Reads = Reads.unite(getDomainFor(MA));
628628

629629
// { DomainRead[] -> Scatter[] }
630630
auto ReadSchedule = getScatterFor(Reads);
@@ -885,7 +885,7 @@ class DeLICMImpl : public ZoneAlgorithm {
885885
auto UniverseWritesDom = isl::union_set::empty(ParamSpace);
886886

887887
for (auto *MA : S->getPHIIncomings(SAI))
888-
UniverseWritesDom = UniverseWritesDom.add_set(getDomainFor(MA));
888+
UniverseWritesDom = UniverseWritesDom.unite(getDomainFor(MA));
889889

890890
auto RelevantWritesTarget = WritesTarget;
891891
if (DelicmOverapproximateWrites)

polly/lib/Transform/MaximalStaticExpansion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ bool MaximalStaticExpander::isExpandable(
189189
for (auto Write : Writes) {
190190
auto MapDeps = filterDependences(S, Dependences, Write);
191191
for (isl::map Map : MapDeps.get_map_list())
192-
WriteDomain = WriteDomain.add_set(Map.range());
192+
WriteDomain = WriteDomain.unite(Map.range());
193193
}
194194

195195
// For now, read from original scalar is not possible.

polly/lib/Transform/ZoneAlgo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
336336
// To avoid solving any ILP problems, always add entire arrays instead of
337337
// just the elements that are accessed.
338338
auto ArrayElts = isl::set::universe(AccRelMap.get_space().range());
339-
AllElts = AllElts.add_set(ArrayElts);
339+
AllElts = AllElts.unite(ArrayElts);
340340

341341
if (MA->isRead()) {
342342
// Reject load after store to same location.
@@ -350,7 +350,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
350350
R << ", loading: " << AccRel << ")";
351351
S->getFunction().getContext().diagnose(R);
352352

353-
IncompatibleElts = IncompatibleElts.add_set(ArrayElts);
353+
IncompatibleElts = IncompatibleElts.unite(ArrayElts);
354354
}
355355

356356
Loads = Loads.unite(AccRel);
@@ -367,7 +367,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
367367
R << "store is in a non-affine subregion";
368368
S->getFunction().getContext().diagnose(R);
369369

370-
IncompatibleElts = IncompatibleElts.add_set(ArrayElts);
370+
IncompatibleElts = IncompatibleElts.unite(ArrayElts);
371371
}
372372

373373
// Do not allow more than one store to the same location.
@@ -380,7 +380,7 @@ void ZoneAlgorithm::collectIncompatibleElts(ScopStmt *Stmt,
380380
R << ", storing: " << AccRel << ")";
381381
S->getFunction().getContext().diagnose(R);
382382

383-
IncompatibleElts = IncompatibleElts.add_set(ArrayElts);
383+
IncompatibleElts = IncompatibleElts.unite(ArrayElts);
384384
}
385385

386386
Stores = Stores.unite(AccRel);

polly/unittests/DeLICM/DeLICMTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ isl::union_set unionSpace(const isl::union_set &USet) {
2727
for (isl::set Set : USet.get_set_list()) {
2828
isl::space Space = Set.get_space();
2929
isl::set Universe = isl::set::universe(Space);
30-
Result = Result.add_set(Universe);
30+
Result = Result.unite(Universe);
3131
}
3232
return Result;
3333
}
@@ -120,7 +120,7 @@ bool checkIsConflictingNonsymmetricCommon(
120120
auto NewSpace = isl::space(Ctx, 0, 1);
121121
NewSpace = NewSpace.set_tuple_id(isl::dim::set, NewId);
122122
auto NewSet = isl::set::universe(NewSpace);
123-
Universe = Universe.add_set(NewSet);
123+
Universe = Universe.unite(NewSet);
124124

125125
// Using the universe, fill missing data.
126126
isl::union_set ExistingOccupied;

0 commit comments

Comments
 (0)