48 lines · plain
1; RUN: opt %loadNPMPolly -polly-stmt-granularity=bb '-passes=polly-custom<simplify>' -polly-print-simplify -disable-output -aa-pipeline=basic-aa < %s | FileCheck -match-full-lines %s2;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 %for15 16for:17 %j = phi i32 [0, %entry], [%j.inc, %inc]18 %j.cmp = icmp slt i32 %j, %n19 br i1 %j.cmp, label %body, label %exit20 21 body:22 store double 10.5, ptr %A23 store double 21.0, ptr %A24 store double 42.0, ptr %A25 br label %inc26 27inc:28 %j.inc = add nuw nsw i32 %j, 129 br label %for30 31exit:32 br label %return33 34return:35 ret void36}37 38 39; CHECK: Statistics {40; CHECK: Overwrites removed: 241; CHECK: }42 43; CHECK: After accesses {44; CHECK-NEXT: Stmt_body45; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]46; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_A[0] };47; CHECK-NEXT: }48