1 ; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-simplify -analyze < %s | FileCheck -match-full-lines %s
3 ; Remove a store that is overwritten by another store in the same statement.
4 ; Check that even multiple stores are removed.
6 ; for (int j = 0; j < n; j += 1) {
12 define void @overwritten_3store(i32 %n, double* noalias nonnull %A) {
17 %j = phi i32 [0, %entry], [%j.inc, %inc]
18 %j.cmp = icmp slt i32 %j, %n
19 br i1 %j.cmp, label %body, label %exit
22 store double 10.5, double* %A
23 store double 21.0, double* %A
24 store double 42.0, double* %A
28 %j.inc = add nuw nsw i32 %j, 1
40 ; CHECK: Overwrites removed: 2
43 ; CHECK: After accesses {
44 ; CHECK-NEXT: Stmt_body
45 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
46 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[0] };