[polly] r235823 - Use all available range information for parameters
Johannes Doerfert
doerfert at cs.uni-saarland.de
Sun Apr 26 13:07:21 PDT 2015
Author: jdoerfert
Date: Sun Apr 26 15:07:21 2015
New Revision: 235823
URL: http://llvm.org/viewvc/llvm-project?rev=235823&view=rev
Log:
Use all available range information for parameters
In the following even full-range information will help to avoid
runtime checks for wrapping integers, hence we enable it now.
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll
polly/trunk/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll
polly/trunk/test/ScopInfo/assume_gep_bounds.ll
polly/trunk/test/ScopInfo/assume_gep_bounds_2.ll
polly/trunk/test/ScopInfo/multidim_3d_parametric_array_static_loop_bounds.ll
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=235823&r1=235822&r2=235823&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Apr 26 15:07:21 2015
@@ -311,18 +311,18 @@ static __isl_give isl_set *addRangeBound
isl_val *V;
isl_ctx *ctx = isl_set_get_ctx(S);
- bool isWrapping = Range.isSignWrappedSet();
- const auto LB = isWrapping ? Range.getLower() : Range.getSignedMin();
+ bool useLowerUpperBound = Range.isSignWrappedSet() && !Range.isFullSet();
+ const auto LB = useLowerUpperBound ? Range.getLower() : Range.getSignedMin();
V = isl_valFromAPInt(ctx, LB, true);
isl_set *SLB = isl_set_lower_bound_val(isl_set_copy(S), type, dim, V);
- const auto UB = isWrapping ? Range.getUpper() : Range.getSignedMax();
+ const auto UB = useLowerUpperBound ? Range.getUpper() : Range.getSignedMax();
V = isl_valFromAPInt(ctx, UB, true);
- if (isWrapping)
+ if (useLowerUpperBound)
V = isl_val_sub_ui(V, 1);
isl_set *SUB = isl_set_upper_bound_val(S, type, dim, V);
- if (isWrapping)
+ if (useLowerUpperBound)
return isl_set_union(SLB, SUB);
else
return isl_set_intersect(SLB, SUB);
@@ -1345,10 +1345,6 @@ void Scop::addParameterBounds() {
ConstantRange SRange = SE->getSignedRange(ParamID.first);
- // TODO: Find a case where the full set is actually helpful.
- if (SRange.isFullSet())
- continue;
-
Context = addRangeBoundsToSet(Context, SRange, dim, isl_dim_param);
}
}
Modified: polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll?rev=235823&r1=235822&r2=235823&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll Sun Apr 26 15:07:21 2015
@@ -5,7 +5,7 @@
; INNERMOST: Region: %bb9---%bb17
; INNERMOST: Max Loop Depth: 1
; INNERMOST: Context:
-; INNERMOST: [N] -> { : }
+; INNERMOST: [N] -> { : N >= -2147483648 and N <= 2147483647 }
; INNERMOST: Assumed Context:
; INNERMOST: [N] -> { : }
; INNERMOST: p0: %N
Modified: polly/trunk/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll?rev=235823&r1=235822&r2=235823&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll Sun Apr 26 15:07:21 2015
@@ -7,7 +7,7 @@
; CHECK: Region: %bb2---%bb24
; CHECK: Max Loop Depth: 1
; CHECK: Context:
-; CHECK: [N] -> { : }
+; CHECK: [N] -> { : N >= -2147483648 and N <= 2147483647 }
; CHECK: Assumed Context:
; CHECK: [N] -> { : }
; CHECK: p0: %N
Modified: polly/trunk/test/ScopInfo/assume_gep_bounds.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/assume_gep_bounds.ll?rev=235823&r1=235822&r2=235823&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/assume_gep_bounds.ll (original)
+++ polly/trunk/test/ScopInfo/assume_gep_bounds.ll Sun Apr 26 15:07:21 2015
@@ -16,7 +16,11 @@
; values for which our assumption holds.
; CHECK: Assumed Context
-; CHECK-NEXT: [n, m, p] -> { : p <= 30 and m <= 20 }
+; CHECK-NEXT: [n, m, p] -> { :
+; CHECK-DAG: p <= 30
+; CHECK-DAG: and
+; CHECK-DAG: m <= 20
+; CHECK: }
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Modified: polly/trunk/test/ScopInfo/assume_gep_bounds_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/assume_gep_bounds_2.ll?rev=235823&r1=235822&r2=235823&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/assume_gep_bounds_2.ll (original)
+++ polly/trunk/test/ScopInfo/assume_gep_bounds_2.ll Sun Apr 26 15:07:21 2015
@@ -16,7 +16,11 @@
; accessed. In this case the value of m does not matter.
; CHECK: Assumed Context:
-; CHECK-NEXT: [n, m, p] -> { : (n >= 1 and m <= 20 and p <= 20) or (n <= 0 and p <= 20) }
+; CHECK-NEXT: [n, m, p] -> { :
+; CHECK-DAG: (n >= 1 and m <= 20 and p <= 20)
+; CHECK-DAG: or
+; CHECK-DAG: (n <= 0 and p <= 20)
+; CHECK: }
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Modified: polly/trunk/test/ScopInfo/multidim_3d_parametric_array_static_loop_bounds.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/multidim_3d_parametric_array_static_loop_bounds.ll?rev=235823&r1=235822&r2=235823&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/multidim_3d_parametric_array_static_loop_bounds.ll (original)
+++ polly/trunk/test/ScopInfo/multidim_3d_parametric_array_static_loop_bounds.ll Sun Apr 26 15:07:21 2015
@@ -10,7 +10,11 @@ target datalayout = "e-p:64:64:64-i1:8:8
; }
; CHECK: Assumed Context:
-; CHECK: [o, m] -> { : m >= 150 and o >= 200 }
+; CHECK: [o, m] -> { :
+; CHECK-DAG: m >= 150
+; CHECK-DAG: and
+; CHECK-DAG: o >= 200
+; CHECK: }
; CHECK: p0: %o
; CHECK: p1: %m
; CHECK: Statements {
More information about the llvm-commits
mailing list