1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-simplify -analyze < %s | FileCheck -match-full-lines %s
3 ; Combine four partial stores into two.
4 ; The stores write to the same array, but never the same element.
6 ; for (int j = 0; j < n; j += 1) {
13 define void @coalesce_disjointelements(i32 %n, double* noalias nonnull %A) {
18 %j = phi i32 [0, %entry], [%j.inc, %inc]
19 %j.cmp = icmp slt i32 %j, %n
20 br i1 %j.cmp, label %body, label %exit
23 %A_0 = getelementptr inbounds double, double* %A, i32 0
24 %A_1 = getelementptr inbounds double, double* %A, i32 1
25 store double 21.0, double* %A_0
26 store double 42.0, double* %A_1
27 store double 21.0, double* %A_0
28 store double 42.0, double* %A_1
32 %j.inc = add nuw nsw i32 %j, 1
44 ; CHECK: Overwrites removed: 0
45 ; CHECK: Partial writes coalesced: 2
48 ; CHECK: After accesses {
49 ; CHECK-NEXT: Stmt_body
50 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
51 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[0] };
52 ; CHECK-NEXT: new: [n] -> { Stmt_body[i0] -> MemRef_A[0] : n <= 2147483647 };
53 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
54 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[1] };
55 ; CHECK-NEXT: new: [n] -> { Stmt_body[i0] -> MemRef_A[1] : n <= 2147483647 };