summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-02-07 13:59:03 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-02-07 13:59:03 +0000
commite708790c5952f9b2f5eaccbedcdb9c883eb8ea5b (patch)
tree402a6f02f57fe5c8a514a6e5cc5532e16aeda46d
parentadeab372ca38f4df97cf99401c0b630e73481bec (diff)
downloadbcm5719-llvm-e708790c5952f9b2f5eaccbedcdb9c883eb8ea5b.tar.gz
bcm5719-llvm-e708790c5952f9b2f5eaccbedcdb9c883eb8ea5b.zip
[FIX] Two "off-by-one" error in constant range usage
llvm-svn: 260031
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp5
-rw-r--r--polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll4
-rw-r--r--polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll4
-rw-r--r--polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll4
-rw-r--r--polly/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll4
-rw-r--r--polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll4
-rw-r--r--polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll4
-rw-r--r--polly/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll2
-rw-r--r--polly/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll2
-rw-r--r--polly/test/ScopInfo/multidim_single_and_multidim_array.ll2
-rw-r--r--polly/test/ScopInfo/multiple-types-non-affine-2.ll79
-rw-r--r--polly/test/ScopInfo/multiple-types-non-affine.ll79
-rw-r--r--polly/test/ScopInfo/non_affine_access.ll2
-rw-r--r--polly/test/ScopInfo/non_affine_region_1.ll4
14 files changed, 179 insertions, 20 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index f215ccdcfea..23c14591912 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -612,11 +612,12 @@ void MemoryAccess::computeBoundsOnAccessRelation(unsigned ElementSize) {
bool isWrapping = Range.isSignWrappedSet();
unsigned BW = Range.getBitWidth();
+ const auto One = APInt(BW, 1);
const auto LB = isWrapping ? Range.getLower() : Range.getSignedMin();
- const auto UB = isWrapping ? Range.getUpper() : Range.getSignedMax();
+ const auto UB = isWrapping ? (Range.getUpper() - One) : Range.getSignedMax();
auto Min = LB.sdiv(APInt(BW, ElementSize));
- auto Max = (UB - APInt(BW, 1)).sdiv(APInt(BW, ElementSize));
+ auto Max = UB.sdiv(APInt(BW, ElementSize)) + One;
isl_set *AccessRange = isl_map_range(isl_map_copy(AccessRelation));
AccessRange =
diff --git a/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll b/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll
index fb1eb411109..51182c3a691 100644
--- a/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll
+++ b/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll
@@ -37,9 +37,9 @@
; SCALAR-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; SCALAR-NEXT: { Stmt_bb3__TO__bb11[i0] -> MemRef_C[i0] };
; SCALAR-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0]
-; SCALAR-NEXT: { Stmt_bb3__TO__bb11[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483645 };
+; SCALAR-NEXT: { Stmt_bb3__TO__bb11[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483647 };
; SCALAR-NEXT: MayWriteAccess := [Reduction Type: +] [Scalar: 0]
-; SCALAR-NEXT: { Stmt_bb3__TO__bb11[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483645 };
+; SCALAR-NEXT: { Stmt_bb3__TO__bb11[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483647 };
; SCALAR-NEXT: }
; PROFIT-NOT: Statements
diff --git a/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll b/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll
index 10bff3439cf..491d38e409a 100644
--- a/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll
+++ b/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll
@@ -97,9 +97,9 @@
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[i1] };
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2305843009213693949 };
+; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2305843009213693951 };
; ALL-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2305843009213693949 };
+; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2305843009213693951 };
; ALL-NEXT: }
;
; void f(int *A) {
diff --git a/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll b/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
index 13d0b907cfe..75ecbefd666 100644
--- a/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
+++ b/polly/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
@@ -95,9 +95,9 @@
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[i1] };
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 4294967293 };
+; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 4294967295 };
; ALL-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 4294967293 };
+; ALL-NEXT: { Stmt_bb15__TO__bb25[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 4294967295 };
; ALL-NEXT: }
;
; void f(int *A) {
diff --git a/polly/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll b/polly/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll
index 228bcf5b521..7a2c80223e6 100644
--- a/polly/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll
+++ b/polly/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll
@@ -13,9 +13,9 @@
; CHECK-NEXT: Schedule :=
; CHECK-NEXT: { Stmt_bb7[i0, i1] -> [i0, i1] };
; CHECK-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0]
-; CHECK-NEXT: { Stmt_bb7[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2046 };
+; CHECK-NEXT: { Stmt_bb7[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2048 };
; CHECK-NEXT: MayWriteAccess := [Reduction Type: +] [Scalar: 0]
-; CHECK-NEXT: { Stmt_bb7[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2046 };
+; CHECK-NEXT: { Stmt_bb7[i0, i1] -> MemRef_A[o0] : 0 <= o0 <= 2048 };
; CHECK-NEXT: }
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
diff --git a/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll b/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll
index c1ae86afe73..f0f9db52df8 100644
--- a/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll
+++ b/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll
@@ -48,9 +48,9 @@
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; ALL-NEXT: { Stmt_bb4__TO__bb17[i0] -> MemRef_A[i0] };
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb4__TO__bb17[i0] -> MemRef_A[o0] : 0 <= o0 <= 2147483645 };
+; ALL-NEXT: { Stmt_bb4__TO__bb17[i0] -> MemRef_A[o0] : 0 <= o0 <= 2147483647 };
; ALL-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb4__TO__bb17[i0] -> MemRef_A[o0] : 0 <= o0 <= 2147483645 };
+; ALL-NEXT: { Stmt_bb4__TO__bb17[i0] -> MemRef_A[o0] : 0 <= o0 <= 2147483647 };
; ALL-NEXT: }
;
; void f(int *A, int N) {
diff --git a/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll b/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll
index a0052f5f1c1..ba018655408 100644
--- a/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll
+++ b/polly/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll
@@ -52,9 +52,9 @@
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; ALL-NEXT: { Stmt_bb4__TO__bb18[i0] -> MemRef_A[i0] };
; ALL-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb4__TO__bb18[i0] -> MemRef_A[o0] : 0 <= o0 <= 2199023254526 };
+; ALL-NEXT: { Stmt_bb4__TO__bb18[i0] -> MemRef_A[o0] : 0 <= o0 <= 2199023254528 };
; ALL-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; ALL-NEXT: { Stmt_bb4__TO__bb18[i0] -> MemRef_A[o0] : 0 <= o0 <= 2199023254526 };
+; ALL-NEXT: { Stmt_bb4__TO__bb18[i0] -> MemRef_A[o0] : 0 <= o0 <= 2199023254528 };
; ALL-NEXT: }
;
; PROFIT-NOT: Statements
diff --git a/polly/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll b/polly/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll
index cd022e2c61c..0cb816df034 100644
--- a/polly/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll
+++ b/polly/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll
@@ -72,7 +72,7 @@
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [N] -> { Stmt_bb18[i0] -> MemRef_j_2__phi[] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
-; CHECK-NEXT: [N] -> { Stmt_bb18[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483645 };
+; CHECK-NEXT: [N] -> { Stmt_bb18[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483647 };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: [N] -> { Stmt_bb18[i0] -> MemRef_A[i0] };
; CHECK-NEXT: Stmt_bb23
diff --git a/polly/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll b/polly/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll
index 1aedfea71ae..027826101a9 100644
--- a/polly/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll
+++ b/polly/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll
@@ -35,5 +35,5 @@ for.end:
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: [n] -> { Stmt_for_body[i0] -> MemRef_INDEX[i0] };
; CHECK-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; CHECK-NEXT: [n] -> { Stmt_for_body[i0] -> MemRef_A[o0] : -1152921504606846976 <= o0 <= 1152921504606846973 };
+; CHECK-NEXT: [n] -> { Stmt_for_body[i0] -> MemRef_A[o0] : -1152921504606846976 <= o0 <= 1152921504606846975 };
; CHECK-NEXT: }
diff --git a/polly/test/ScopInfo/multidim_single_and_multidim_array.ll b/polly/test/ScopInfo/multidim_single_and_multidim_array.ll
index 20ef5257313..3e3d6f06920 100644
--- a/polly/test/ScopInfo/multidim_single_and_multidim_array.ll
+++ b/polly/test/ScopInfo/multidim_single_and_multidim_array.ll
@@ -29,7 +29,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
; NONAFFINE-NEXT: Schedule :=
; NONAFFINE-NEXT: [n, p_1] -> { Stmt_for_i_1[i0] -> [0, i0] };
; NONAFFINE-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; NONAFFINE-NEXT: [n, p_1] -> { Stmt_for_i_1[i0] -> MemRef_X[o0] : -2305843009213693952 <= o0 <= 2305843009213693949 };
+; NONAFFINE-NEXT: [n, p_1] -> { Stmt_for_i_1[i0] -> MemRef_X[o0] : -2305843009213693952 <= o0 <= 2305843009213693951 };
; NONAFFINE-NEXT: Stmt_for_i_2
; NONAFFINE-NEXT: Domain :=
; NONAFFINE-NEXT: [n, p_1] -> { Stmt_for_i_2[i0] : 0 <= i0 < n };
diff --git a/polly/test/ScopInfo/multiple-types-non-affine-2.ll b/polly/test/ScopInfo/multiple-types-non-affine-2.ll
new file mode 100644
index 00000000000..8c9ac430812
--- /dev/null
+++ b/polly/test/ScopInfo/multiple-types-non-affine-2.ll
@@ -0,0 +1,79 @@
+; RUN: opt %loadPolly -polly-allow-differing-element-types -polly-scops -polly-allow-nonaffine -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-allow-differing-element-types -polly-codegen -polly-allow-nonaffine -analyze
+;
+; // Check that accessing one array with different types works,
+; // even though some accesses are non-affine.
+; void multiple_types(char *Short, short *Char, char *Double) {
+; for (long i = 0; i < 100; i++) {
+; Short[i] = *(short *)&Short[i & 8];
+; Char[i] = *(float *)&Char[i & 8];
+; Double[i] = *(double *)&Double[i & 8];
+; }
+; }
+;
+; CHECK: Arrays {
+; CHECK: i16 MemRef_Short[*]; // Element size 2
+; CHECK: i8 MemRef_Char[*]; // Element size 1
+; CHECK: i32 MemRef_Double[*]; // Element size 4
+; CHECK: }
+;
+; CHECK: Statements {
+; CHECK-NEXT: Stmt_bb2
+; CHECK-NEXT: Domain :=
+; CHECK-NEXT: { Stmt_bb2[i0] : 0 <= i0 <= 99 };
+; CHECK-NEXT: Schedule :=
+; CHECK-NEXT: { Stmt_bb2[i0] -> [i0] };
+; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Short[o0] : 0 <= o0 <= 16 };
+; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Short[o0] : 2i0 <= o0 <= 1 + 2i0 };
+; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Char[o0] : 0 <= o0 <= 32 };
+; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Char[o0] : 4i0 <= o0 <= 3 + 4i0 };
+; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Double[o0] : 0 <= o0 <= 9 };
+; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Double[i0] };
+; CHECK-NEXT: }
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @multiple_types(i32* noalias %Short, i32* noalias %Char, i32* noalias %Double) {
+bb:
+ br label %bb1
+
+bb1: ; preds = %bb20, %bb
+ %i.0 = phi i64 [ 0, %bb ], [ %tmp21, %bb20 ]
+ %exitcond = icmp ne i64 %i.0, 100
+ br i1 %exitcond, label %bb2, label %bb22
+
+bb2: ; preds = %bb1
+ %quad = and i64 %i.0, 8
+ %tmp3 = getelementptr inbounds i32, i32* %Short, i64 %quad
+ %tmp4 = bitcast i32* %tmp3 to i16*
+ %tmp5 = load i16, i16* %tmp4, align 2
+ %tmp6 = zext i16 %tmp5 to i32
+ %tmp7 = getelementptr inbounds i32, i32* %Short, i64 %i.0
+ store i32 %tmp6, i32* %tmp7, align 1
+ %tmp9 = getelementptr inbounds i32, i32* %Char, i64 %quad
+ %tmp10 = bitcast i32* %tmp9 to i8*
+ %tmp11 = load i8, i8* %tmp10, align 4
+ %tmp12 = zext i8 %tmp11 to i32
+ %tmp13 = getelementptr inbounds i32, i32* %Char, i64 %i.0
+ store i32 %tmp12, i32* %tmp13, align 1
+ %tmp15 = getelementptr inbounds i32, i32* %Double, i64 %quad
+ %tmp16 = bitcast i32* %tmp15 to double*
+ %tmp17 = load double, double* %tmp16, align 8
+ %tmp18 = fptosi double %tmp17 to i32
+ %tmp19 = getelementptr inbounds i32, i32* %Double, i64 %i.0
+ store i32 %tmp18, i32* %tmp19, align 1
+ br label %bb20
+
+bb20: ; preds = %bb2
+ %tmp21 = add nuw nsw i64 %i.0, 1
+ br label %bb1
+
+bb22: ; preds = %bb1
+ ret void
+}
diff --git a/polly/test/ScopInfo/multiple-types-non-affine.ll b/polly/test/ScopInfo/multiple-types-non-affine.ll
new file mode 100644
index 00000000000..06ce53a5978
--- /dev/null
+++ b/polly/test/ScopInfo/multiple-types-non-affine.ll
@@ -0,0 +1,79 @@
+; RUN: opt %loadPolly -polly-allow-differing-element-types -polly-scops -polly-allow-nonaffine -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-allow-differing-element-types -polly-codegen -polly-allow-nonaffine -analyze
+;
+; // Check that accessing one array with different types works,
+; // even though some accesses are non-affine.
+; void multiple_types(char *Short, short *Float, char *Double) {
+; for (long i = 0; i < 100; i++) {
+; Short[i] = *(short *)&Short[i & 8];
+; Float[i] = *(float *)&Float[i & 8];
+; Double[i] = *(double *)&Double[i & 8];
+; }
+; }
+;
+; CHECK: Arrays {
+; CHECK: i8 MemRef_Short[*]; // Element size 1
+; CHECK: i16 MemRef_Float[*]; // Element size 2
+; CHECK: i8 MemRef_Double[*]; // Element size 1
+; CHECK: }
+;
+; CHECK: Statements {
+; CHECK-NEXT: Stmt_bb2
+; CHECK-NEXT: Domain :=
+; CHECK-NEXT: { Stmt_bb2[i0] : 0 <= i0 <= 99 };
+; CHECK-NEXT: Schedule :=
+; CHECK-NEXT: { Stmt_bb2[i0] -> [i0] };
+; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Short[o0] : 0 <= o0 <= 9 };
+; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Short[i0] };
+; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Float[o0] : 0 <= o0 <= 9 };
+; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Float[i0] };
+; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Double[o0] : 0 <= o0 <= 15 };
+; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
+; CHECK-NEXT: { Stmt_bb2[i0] -> MemRef_Double[i0] };
+; CHECK-NEXT: }
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @multiple_types(i8* noalias %Short, i16* noalias %Float, i8* noalias %Double) {
+bb:
+ br label %bb1
+
+bb1: ; preds = %bb20, %bb
+ %i.0 = phi i64 [ 0, %bb ], [ %tmp21, %bb20 ]
+ %exitcond = icmp ne i64 %i.0, 100
+ br i1 %exitcond, label %bb2, label %bb22
+
+bb2: ; preds = %bb1
+ %quad = and i64 %i.0, 8
+ %tmp3 = getelementptr inbounds i8, i8* %Short, i64 %quad
+ %tmp4 = bitcast i8* %tmp3 to i16*
+ %tmp5 = load i16, i16* %tmp4, align 2
+ %tmp6 = trunc i16 %tmp5 to i8
+ %tmp7 = getelementptr inbounds i8, i8* %Short, i64 %i.0
+ store i8 %tmp6, i8* %tmp7, align 1
+ %tmp9 = getelementptr inbounds i16, i16* %Float, i64 %quad
+ %tmp10 = bitcast i16* %tmp9 to float*
+ %tmp11 = load float, float* %tmp10, align 4
+ %tmp12 = fptosi float %tmp11 to i16
+ %tmp13 = getelementptr inbounds i16, i16* %Float, i64 %i.0
+ store i16 %tmp12, i16* %tmp13, align 1
+ %tmp15 = getelementptr inbounds i8, i8* %Double, i64 %quad
+ %tmp16 = bitcast i8* %tmp15 to double*
+ %tmp17 = load double, double* %tmp16, align 8
+ %tmp18 = fptosi double %tmp17 to i8
+ %tmp19 = getelementptr inbounds i8, i8* %Double, i64 %i.0
+ store i8 %tmp18, i8* %tmp19, align 1
+ br label %bb20
+
+bb20: ; preds = %bb2
+ %tmp21 = add nuw nsw i64 %i.0, 1
+ br label %bb1
+
+bb22: ; preds = %bb1
+ ret void
+}
diff --git a/polly/test/ScopInfo/non_affine_access.ll b/polly/test/ScopInfo/non_affine_access.ll
index 18528ceec88..a849220efde 100644
--- a/polly/test/ScopInfo/non_affine_access.ll
+++ b/polly/test/ScopInfo/non_affine_access.ll
@@ -30,4 +30,4 @@ for.end: ; preds = %for.body
}
; CHECK-NOT: Stmt_for_body
-; NONAFFINE: { Stmt_for_body[i0] -> MemRef_A[o0] : -1152921504606846976 <= o0 <= 1152921504606846973 };
+; NONAFFINE: { Stmt_for_body[i0] -> MemRef_A[o0] : -1152921504606846976 <= o0 <= 1152921504606846975 };
diff --git a/polly/test/ScopInfo/non_affine_region_1.ll b/polly/test/ScopInfo/non_affine_region_1.ll
index dc142eb0e6b..7f5fb4a24e7 100644
--- a/polly/test/ScopInfo/non_affine_region_1.ll
+++ b/polly/test/ScopInfo/non_affine_region_1.ll
@@ -51,9 +51,9 @@
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]
; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_x_1__phi[] };
; CHECK-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 0]
-; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483645 };
+; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483647 };
; CHECK-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483645 };
+; CHECK-NEXT: [b] -> { Stmt_bb10__TO__bb18[i0] -> MemRef_A[o0] : -2147483648 <= o0 <= 2147483647 };
; CHECK-NEXT: }
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
OpenPOWER on IntegriCloud