1 ; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-import-jscop,print<polly-simplify>' -polly-import-jscop-postfix=transformed -disable-output < %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, ptr 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_1 = getelementptr inbounds double, ptr %A, i32 1
24 store double 21.0, ptr %A
25 store double 42.0, ptr %A_1
26 store double 21.0, ptr %A
27 store double 42.0, ptr %A_1
31 %j.inc = add nuw nsw i32 %j, 1
43 ; CHECK: Overwrites removed: 0
44 ; CHECK: Partial writes coalesced: 2
47 ; CHECK: After accesses {
48 ; CHECK-NEXT: Stmt_body
49 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
50 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[0] };
51 ; CHECK-NEXT: new: [n] -> { Stmt_body[i0] -> MemRef_A[0] };
52 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
53 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[1] };
54 ; CHECK-NEXT: new: [n] -> { Stmt_body[i0] -> MemRef_A[1] };