62 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<import-jscop;simplify-0>' -polly-print-simplify -polly-import-jscop-postfix=transformed -disable-output < %s | FileCheck -match-full-lines %s2;3; Remove identical writes4; (two stores in the same statement that write the same value to the same5; destination)6;7; for (int j = 0; j < n; j += 1) {8; body:9; val = 21.0 + 21.0;10; A[1] = val;11; A[1] = val;12; A[1] = val;13;14; user:15; A[0] = A[1];16; }17;18define void @overwritten_3phi(i32 %n, ptr noalias nonnull %A) {19entry:20 br label %for21 22for:23 %j = phi i32 [0, %entry], [%j.inc, %inc]24 %j.cmp = icmp slt i32 %j, %n25 br i1 %j.cmp, label %body, label %exit26 27 body:28 %val = fadd double 21.0, 21.029 br label %user30 31 user:32 %phi1 = phi double [%val, %body]33 %phi2 = phi double [%val, %body]34 %phi3 = phi double [%val, %body]35 %add1 = fadd double %phi1, %phi236 %add2 = fadd double %add1, %phi337 store double %add2, ptr %A38 br label %inc39 40inc:41 %j.inc = add nuw nsw i32 %j, 142 br label %for43 44exit:45 br label %return46 47return:48 ret void49}50 51 52 53; CHECK: Statistics {54; CHECK: Overwrites removed: 255; CHECK: }56 57; CHECK: Stmt_body58; 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_user62