1 ; RUN: opt %loadPolly -polly-simplify -analyze < %s | FileCheck %s -match-full-lines
3 ; Remove a dead value write/read pair
4 ; (accesses that are effectively not used)
6 ; for (int j = 0; j < n; j += 1) {
8 ; double val = 12.5 + 12.5;
11 ; double unused = val + 21.0;
15 define void @func(i32 %n, double* noalias nonnull %A) {
20 %j = phi i32 [0, %entry], [%j.inc, %inc]
21 %j.cmp = icmp slt i32 %j, %n
22 br i1 %j.cmp, label %body, label %exit
25 %val = fadd double 12.5, 12.5
29 %unused = fadd double %val, 21.0
30 store double 42.0, double* %A
34 %j.inc = add nuw nsw i32 %j, 1
46 ; CHECK: Dead accesses removed: 2
47 ; CHECK: Dead instructions removed: 2
48 ; CHECK: Stmts removed: 1
51 ; CHECK: After accesses {
52 ; CHECK-NEXT: Stmt_body_succ
53 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
54 ; CHECK-NEXT: [n] -> { Stmt_body_succ[i0] -> MemRef_A[0] };