[polly] r260031 - [FIX] Two "off-by-one" error in constant range usage
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 7 05:59:03 PST 2016
Author: jdoerfert
Date: Sun Feb 7 07:59:03 2016
New Revision: 260031
URL: http://llvm.org/viewvc/llvm-project?rev=260031&view=rev
Log:
[FIX] Two "off-by-one" error in constant range usage
Added:
polly/trunk/test/ScopInfo/multiple-types-non-affine-2.ll
polly/trunk/test/ScopInfo/multiple-types-non-affine.ll
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll
polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll
polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
polly/trunk/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll
polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll
polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll
polly/trunk/test/ScopInfo/NonAffine/non_affine_loop_used_later.ll
polly/trunk/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll
polly/trunk/test/ScopInfo/multidim_single_and_multidim_array.ll
polly/trunk/test/ScopInfo/non_affine_access.ll
polly/trunk/test/ScopInfo/non_affine_region_1.ll
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Feb 7 07:59:03 2016
@@ -612,11 +612,12 @@ void MemoryAccess::computeBoundsOnAccess
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 =
Modified: polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_1.ll Sun Feb 7 07:59:03 2016
@@ -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
Modified: polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll Sun Feb 7 07:59:03 2016
@@ -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) {
Modified: polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll Sun Feb 7 07:59:03 2016
@@ -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) {
Modified: polly/trunk/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non_affine_access_with_range_2.ll Sun Feb 7 07:59:03 2016
@@ -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"
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=260031&r1=260030&r2=260031&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 Feb 7 07:59:03 2016
@@ -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) {
Modified: polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll Sun Feb 7 07:59:03 2016
@@ -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
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=260031&r1=260030&r2=260031&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 Feb 7 07:59:03 2016
@@ -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
Modified: polly/trunk/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll (original)
+++ polly/trunk/test/ScopInfo/NonAffine/non_affine_parametric_loop.ll Sun Feb 7 07:59:03 2016
@@ -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: }
Modified: polly/trunk/test/ScopInfo/multidim_single_and_multidim_array.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/multidim_single_and_multidim_array.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/multidim_single_and_multidim_array.ll (original)
+++ polly/trunk/test/ScopInfo/multidim_single_and_multidim_array.ll Sun Feb 7 07:59:03 2016
@@ -29,7 +29,7 @@ target datalayout = "e-m:e-i64:64-f80:12
; 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 };
Added: polly/trunk/test/ScopInfo/multiple-types-non-affine-2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/multiple-types-non-affine-2.ll?rev=260031&view=auto
==============================================================================
--- polly/trunk/test/ScopInfo/multiple-types-non-affine-2.ll (added)
+++ polly/trunk/test/ScopInfo/multiple-types-non-affine-2.ll Sun Feb 7 07:59:03 2016
@@ -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
+}
Added: polly/trunk/test/ScopInfo/multiple-types-non-affine.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/multiple-types-non-affine.ll?rev=260031&view=auto
==============================================================================
--- polly/trunk/test/ScopInfo/multiple-types-non-affine.ll (added)
+++ polly/trunk/test/ScopInfo/multiple-types-non-affine.ll Sun Feb 7 07:59:03 2016
@@ -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
+}
Modified: polly/trunk/test/ScopInfo/non_affine_access.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/non_affine_access.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/non_affine_access.ll (original)
+++ polly/trunk/test/ScopInfo/non_affine_access.ll Sun Feb 7 07:59:03 2016
@@ -30,4 +30,4 @@ for.end:
}
; 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 };
Modified: polly/trunk/test/ScopInfo/non_affine_region_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/non_affine_region_1.ll?rev=260031&r1=260030&r2=260031&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/non_affine_region_1.ll (original)
+++ polly/trunk/test/ScopInfo/non_affine_region_1.ll Sun Feb 7 07:59:03 2016
@@ -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"
More information about the llvm-commits
mailing list