1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-print-simplify -disable-output < %s | FileCheck -match-full-lines %s
3 ; Do not combine stores if there is a read between them.
4 ; Note: The read between is unused, so will be removed by markAndSweep.
5 ; However, searches for coalesces takes place before.
7 ; for (int j = 0; j < n; j += 1) {
13 define void @nocoalesce_readbetween(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 store double 42.0, ptr %A
24 %tmp = load double, ptr %A
25 store double 42.0, ptr %A
29 %j.inc = add nuw nsw i32 %j, 1
41 ; CHECK: Overwrites removed: 0
42 ; CHECK: Partial writes coalesced: 0
45 ; CHECK: After accesses {
46 ; CHECK-NEXT: Stmt_body
47 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
48 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[0] };
49 ; CHECK-NEXT: new: [n] -> { Stmt_body[i0] -> MemRef_A[0] : i0 >= 17 };
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] : i0 <= 16 };