1 ; RUN: opt %loadNPMPolly '-passes=polly-import-jscop,print<polly-simplify>' -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck -match-full-lines %s
3 ; Remove identical writes
4 ; (two stores in the same statement that write the same value to the same
7 ; for (int j = 0; j < n; j += 1) {
18 define void @overwritten_3phi(i32 %n, ptr noalias nonnull %A) {
23 %j = phi i32 [0, %entry], [%j.inc, %inc]
24 %j.cmp = icmp slt i32 %j, %n
25 br i1 %j.cmp, label %body, label %exit
28 %val = fadd double 21.0, 21.0
32 %phi1 = phi double [%val, %body]
33 %phi2 = phi double [%val, %body]
34 %phi3 = phi double [%val, %body]
35 %add1 = fadd double %phi1, %phi2
36 %add2 = fadd double %add1, %phi3
37 store double %add2, ptr %A
41 %j.inc = add nuw nsw i32 %j, 1
54 ; CHECK: Overwrites removed: 2
58 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]
59 ; CHECK-NEXT: [n] -> { Stmt_body[i0] -> MemRef_phi3__phi[] };
60 ; CHECK-NEXT: new: [n] -> { Stmt_body[i0] -> MemRef_A[1] };
61 ; CHECK-NEXT: Stmt_user