[polly] r339312 - Update isl-cpp bindings
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 8 22:07:15 PDT 2018
Author: grosser
Date: Wed Aug 8 22:07:14 2018
New Revision: 339312
URL: http://llvm.org/viewvc/llvm-project?rev=339312&view=rev
Log:
Update isl-cpp bindings
We upstreamed the export of isl_val_2exp, to the official cpp bindings.
In this process, we concluded that pow2 is a better and more widely used
name for this functionality. Hence, both the official isl-cpp bindings
and our derived variant use now the term pow2.
Modified:
polly/trunk/lib/External/isl/include/isl/isl-noexceptions.h
polly/trunk/lib/Support/SCEVAffinator.cpp
polly/trunk/unittests/Isl/IslTest.cpp
Modified: polly/trunk/lib/External/isl/include/isl/isl-noexceptions.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/External/isl/include/isl/isl-noexceptions.h?rev=339312&r1=339311&r2=339312&view=diff
==============================================================================
--- polly/trunk/lib/External/isl/include/isl/isl-noexceptions.h (original)
+++ polly/trunk/lib/External/isl/include/isl/isl-noexceptions.h Wed Aug 8 22:07:14 2018
@@ -3659,7 +3659,6 @@ public:
inline std::string to_str() const;
inline void dump() const;
- inline val two_exp() const;
inline val abs() const;
inline boolean abs_eq(const val &v2) const;
inline val add(val v2) const;
@@ -3706,6 +3705,7 @@ public:
static inline val neginfty(ctx ctx);
static inline val negone(ctx ctx);
static inline val one(ctx ctx);
+ inline val pow2() const;
inline val set_si(long i) const;
inline int sgn() const;
inline val sub(val v2) const;
@@ -14168,7 +14168,7 @@ stat schedule_node::foreach_ancestor_top
} fn_data = { &fn };
auto fn_lambda = [](isl_schedule_node *arg_0, void *arg_1) -> isl_stat {
auto *data = static_cast<struct fn_data *>(arg_1);
- stat ret = (*data->func)(manage(arg_0));
+ stat ret = (*data->func)(manage_copy(arg_0));
return ret.release();
};
auto res = isl_schedule_node_foreach_ancestor_top_down(get(), fn_lambda, &fn_data);
@@ -19087,12 +19087,6 @@ void val::dump() const {
}
-val val::two_exp() const
-{
- auto res = isl_val_2exp(copy());
- return manage(res);
-}
-
val val::abs() const
{
auto res = isl_val_abs(copy());
@@ -19369,6 +19363,12 @@ val val::one(ctx ctx)
return manage(res);
}
+val val::pow2() const
+{
+ auto res = isl_val_pow2(copy());
+ return manage(res);
+}
+
val val::set_si(long i) const
{
auto res = isl_val_set_si(copy(), i);
Modified: polly/trunk/lib/Support/SCEVAffinator.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/SCEVAffinator.cpp?rev=339312&r1=339311&r2=339312&view=diff
==============================================================================
--- polly/trunk/lib/Support/SCEVAffinator.cpp (original)
+++ polly/trunk/lib/Support/SCEVAffinator.cpp Wed Aug 8 22:07:14 2018
@@ -157,7 +157,7 @@ isl::pw_aff SCEVAffinator::addModuloSema
unsigned Width = TD.getTypeSizeInBits(ExprType);
auto ModVal = isl::val::int_from_ui(Ctx, Width);
- ModVal = ModVal.two_exp();
+ ModVal = ModVal.pow2();
isl::set Domain = PWA.domain();
isl::pw_aff AddPW =
Modified: polly/trunk/unittests/Isl/IslTest.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/unittests/Isl/IslTest.cpp?rev=339312&r1=339311&r2=339312&view=diff
==============================================================================
--- polly/trunk/unittests/Isl/IslTest.cpp (original)
+++ polly/trunk/unittests/Isl/IslTest.cpp Wed Aug 8 22:07:14 2018
@@ -145,7 +145,7 @@ TEST(Isl, APIntToIslVal) {
{
APInt APNOne(32, (1ull << 32) - 1, false);
auto IslNOne = valFromAPInt(IslCtx, APNOne, false);
- auto IslRef = isl::val(IslCtx, 32).two_exp().sub_ui(1);
+ auto IslRef = isl::val(IslCtx, 32).pow2().sub_ui(1);
EXPECT_EQ(IslNOne, IslRef);
}
@@ -154,7 +154,7 @@ TEST(Isl, APIntToIslVal) {
APLarge = APLarge.shl(70);
auto IslLarge = valFromAPInt(IslCtx, APLarge, false);
auto IslRef = isl::val(IslCtx, 71);
- IslRef = IslRef.two_exp();
+ IslRef = IslRef.pow2();
EXPECT_EQ(IslLarge, IslRef);
}
@@ -232,7 +232,7 @@ TEST(Isl, IslValToAPInt) {
}
{
- auto IslNOne = isl::val(IslCtx, 32).two_exp().sub_ui(1);
+ auto IslNOne = isl::val(IslCtx, 32).pow2().sub_ui(1);
auto APNOne = APIntFromVal(IslNOne);
EXPECT_EQ((1ull << 32) - 1, APNOne);
EXPECT_EQ(33u, APNOne.getBitWidth());
@@ -240,7 +240,7 @@ TEST(Isl, IslValToAPInt) {
{
auto IslLargeNum = isl::val(IslCtx, 60);
- IslLargeNum = IslLargeNum.two_exp();
+ IslLargeNum = IslLargeNum.pow2();
IslLargeNum = IslLargeNum.sub_ui(1);
auto APLargeNum = APIntFromVal(IslLargeNum);
EXPECT_EQ((1ull << 60) - 1, APLargeNum);
@@ -249,7 +249,7 @@ TEST(Isl, IslValToAPInt) {
{
auto IslExp = isl::val(IslCtx, 500);
- auto IslLargePow2 = IslExp.two_exp();
+ auto IslLargePow2 = IslExp.pow2();
auto APLargePow2 = APIntFromVal(IslLargePow2);
EXPECT_TRUE(APLargePow2.isPowerOf2());
EXPECT_EQ(502u, APLargePow2.getBitWidth());
@@ -258,7 +258,7 @@ TEST(Isl, IslValToAPInt) {
{
auto IslExp = isl::val(IslCtx, 500);
- auto IslLargeNPow2 = IslExp.two_exp().neg();
+ auto IslLargeNPow2 = IslExp.pow2().neg();
auto APLargeNPow2 = APIntFromVal(IslLargeNPow2);
EXPECT_EQ(501u, APLargeNPow2.getBitWidth());
EXPECT_EQ(501u, APLargeNPow2.getMinSignedBits());
@@ -267,7 +267,7 @@ TEST(Isl, IslValToAPInt) {
{
auto IslExp = isl::val(IslCtx, 512);
- auto IslLargePow2 = IslExp.two_exp();
+ auto IslLargePow2 = IslExp.pow2();
auto APLargePow2 = APIntFromVal(IslLargePow2);
EXPECT_TRUE(APLargePow2.isPowerOf2());
EXPECT_EQ(514u, APLargePow2.getBitWidth());
@@ -276,7 +276,7 @@ TEST(Isl, IslValToAPInt) {
{
auto IslExp = isl::val(IslCtx, 512);
- auto IslLargeNPow2 = IslExp.two_exp().neg();
+ auto IslLargeNPow2 = IslExp.pow2().neg();
auto APLargeNPow2 = APIntFromVal(IslLargeNPow2);
EXPECT_EQ(513u, APLargeNPow2.getBitWidth());
EXPECT_EQ(513u, APLargeNPow2.getMinSignedBits());
More information about the llvm-commits
mailing list