diff options
author | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2015-04-26 20:07:21 +0000 |
---|---|---|
committer | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2015-04-26 20:07:21 +0000 |
commit | 8f8af43fefd1d0a413e88df77d1bea42b07f373c (patch) | |
tree | a80bed72e8d39110f8357a66e5ce8bfdac5b9034 /polly/lib/Analysis/ScopInfo.cpp | |
parent | d5d8f67dc5ec18bfd172dc620a49f68db898512d (diff) | |
download | bcm5719-llvm-8f8af43fefd1d0a413e88df77d1bea42b07f373c.tar.gz bcm5719-llvm-8f8af43fefd1d0a413e88df77d1bea42b07f373c.zip |
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.
llvm-svn: 235823
Diffstat (limited to 'polly/lib/Analysis/ScopInfo.cpp')
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 2caab15adfa..6f8de706fb0 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -311,18 +311,18 @@ static __isl_give isl_set *addRangeBoundsToSet(__isl_take isl_set *S, 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); } } |