56 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 %s -match-full-lines2;3; Remove a dead value write/read pair4; (accesses that are effectively not used)5;6; for (int j = 0; j < n; j += 1) {7; body:8; double val = 12.5 + 12.5;9;10; body_succ:11; double unused = val + 21.0;12; A[0] = 42.0;13; }14;15define void @func(i32 %n, ptr noalias nonnull %A) {16entry:17 br label %for18 19for:20 %j = phi i32 [0, %entry], [%j.inc, %inc]21 %j.cmp = icmp slt i32 %j, %n22 br i1 %j.cmp, label %body, label %exit23 24 body:25 %val = fadd double 12.5, 12.526 br label %body_succ27 28 body_succ:29 %unused = fadd double %val, 21.030 store double 42.0, ptr %A31 br label %inc32 33inc:34 %j.inc = add nuw nsw i32 %j, 135 br label %for36 37exit:38 br label %return39 40return:41 ret void42}43 44 45; CHECK: Statistics {46; CHECK: Dead accesses removed: 247; CHECK: Dead instructions removed: 248; CHECK: Stmts removed: 149; CHECK: }50 51; CHECK: After accesses {52; CHECK-NEXT: Stmt_body_succ53; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]54; CHECK-NEXT: [n] -> { Stmt_body_succ[i0] -> MemRef_A[0] };55; CHECK-NEXT: }56