1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb "-passes=scop(print<polly-simplify>)" -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s 2; 3; Remove a store that is overwritten by another store in the same statement. 4; Check that even multiple stores are removed. 5; 6; for (int j = 0; j < n; j += 1) { 7; A[0] = 10.5; 8; A[0] = 21.0; 9; A[0] = 42.0; 10; } 11; 12define void @overwritten_3store(i32 %n, ptr noalias nonnull %A) { 13entry: 14 br label %for 15 16for: 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 20 21 body: 22 store double 10.5, ptr %A 23 store double 21.0, ptr %A 24 store double 42.0, ptr %A 25 br label %inc 26 27inc: 28 %j.inc = add nuw nsw i32 %j, 1 29 br label %for 30 31exit: 32 br label %return 33 34return: 35 ret void 36} 37 38 39; CHECK: Statistics { 40; CHECK: Overwrites removed: 2 41; CHECK: } 42 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] }; 47; CHECK-NEXT: } 48