brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · a1e7da4 Raw
57 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;13; user:14;   A[0] = A[1];15; }16;17define void @overwritten_scalar(i32 %n, ptr noalias nonnull %A) {18entry:19  br label %for20 21for:22  %j = phi i32 [0, %entry], [%j.inc, %inc]23  %j.cmp = icmp slt i32 %j, %n24  br i1 %j.cmp, label %body, label %exit25 26    body:27      %val = fadd double 21.0, 21.028      br label %user29 30    user:31      %phi = phi double [%val, %body]32      %add = fadd double %val, %phi33      store double %add, ptr %A34      br label %inc35 36inc:37  %j.inc = add nuw nsw i32 %j, 138  br label %for39 40exit:41  br label %return42 43return:44  ret void45}46 47 48; CHECK: Statistics {49; CHECK:     Overwrites removed: 150; CHECK: }51 52; CHECK:      Stmt_body53; CHECK-NEXT:     MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]54; CHECK-NEXT:            [n] -> { Stmt_body[i0] ->  MemRef_val[] };55; CHECK-NEXT:       new: [n] -> { Stmt_body[i0] -> MemRef_A[1] };56; CHECK-NEXT: Stmt_user57