Skip to content

Commit

Permalink
[Polly][Isl] Use isl::val::sub instead of isl::val::sub_ui. NFC
Browse files Browse the repository at this point in the history
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::val::sub` instead of `isl::val::sub_ui`
 - `isl-noexceptions.h` has been generated by patacca/isl@355e841

Depends on D107225

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D107293
  • Loading branch information
patacca committed Aug 17, 2021
1 parent 1689dad commit ce8272a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion polly/lib/Analysis/ScopInfo.cpp
Expand Up @@ -195,7 +195,7 @@ static isl::set addRangeBoundsToSet(isl::set S, const ConstantRange &Range,
isl::set SLB = S.lower_bound_val(type, dim, V);

V = valFromAPInt(Ctx.get(), Range.getUpper(), true);
V = V.sub_ui(1);
V = V.sub(1);
isl::set SUB = S.upper_bound_val(type, dim, V);
S = SLB.unite(SUB);
}
Expand Down
7 changes: 0 additions & 7 deletions polly/lib/External/isl/include/isl/isl-noexceptions.h
Expand Up @@ -4801,7 +4801,6 @@ class val {
inline int sgn() const;
inline isl::val sub(isl::val v2) const;
inline isl::val sub(long v2) const;
inline isl::val sub_ui(unsigned long v2) const;
inline isl::val_list to_list() const;
inline isl::val trunc() const;
static inline isl::val zero(isl::ctx ctx);
Expand Down Expand Up @@ -22787,12 +22786,6 @@ isl::val val::sub(long v2) const
return this->sub(isl::val(ctx(), v2));
}

isl::val val::sub_ui(unsigned long v2) const
{
auto res = isl_val_sub_ui(copy(), v2);
return manage(res);
}

isl::val_list val::to_list() const
{
auto res = isl_val_to_list(copy());
Expand Down
6 changes: 3 additions & 3 deletions polly/unittests/Isl/IslTest.cpp
Expand Up @@ -136,7 +136,7 @@ TEST(Isl, APIntToIslVal) {
{
APInt APNOne(32, (1ull << 32) - 1, false);
auto IslNOne = valFromAPInt(IslCtx, APNOne, false);
auto IslRef = isl::val(IslCtx, 32).pow2().sub_ui(1);
auto IslRef = isl::val(IslCtx, 32).pow2().sub(1);
EXPECT_EQ(IslNOne, IslRef);
}

Expand Down Expand Up @@ -223,7 +223,7 @@ TEST(Isl, IslValToAPInt) {
}

{
auto IslNOne = isl::val(IslCtx, 32).pow2().sub_ui(1);
auto IslNOne = isl::val(IslCtx, 32).pow2().sub(1);
auto APNOne = APIntFromVal(IslNOne);
EXPECT_EQ((1ull << 32) - 1, APNOne);
EXPECT_EQ(33u, APNOne.getBitWidth());
Expand All @@ -232,7 +232,7 @@ TEST(Isl, IslValToAPInt) {
{
auto IslLargeNum = isl::val(IslCtx, 60);
IslLargeNum = IslLargeNum.pow2();
IslLargeNum = IslLargeNum.sub_ui(1);
IslLargeNum = IslLargeNum.sub(1);
auto APLargeNum = APIntFromVal(IslLargeNum);
EXPECT_EQ((1ull << 60) - 1, APLargeNum);
EXPECT_EQ(61u, APLargeNum.getBitWidth());
Expand Down

0 comments on commit ce8272a

Please sign in to comment.