1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; Check we remove read only statements.
6 ; CHECK-NEXT: Stmt_for_body_2
7 ; CHECK-NEXT: Domain :=
8 ; CHECK-NEXT: { Stmt_for_body_2[i0] : 0 <= i0 <= 99 };
9 ; CHECK-NEXT: Schedule :=
10 ; CHECK-NEXT: { Stmt_for_body_2[i0] -> [i0] };
11 ; CHECK-NEXT: ReadAccess := [Reduction Type: +] [Scalar: 0]
12 ; CHECK-NEXT: { Stmt_for_body_2[i0] -> MemRef_A[i0] };
13 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0]
14 ; CHECK-NEXT: { Stmt_for_body_2[i0] -> MemRef_A[i0] };
19 ; for (int i = 0; i < 100; i++) {
32 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
34 define void @f(ptr %A) {
38 for.cond: ; preds = %for.inc, %entry
39 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
40 %exitcond = icmp ne i64 %indvars.iv, 100
41 br i1 %exitcond, label %for.body, label %for.end
43 for.body: ; preds = %for.cond
44 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
45 %tmp = load i32, ptr %arrayidx, align 4
49 %arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
50 %tmp1 = load i32, ptr %arrayidx2, align 4
54 %arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
55 %tmp2 = load i32, ptr %arrayidx5, align 4
56 %add = add nsw i32 %tmp2, 1
57 store i32 %add, ptr %arrayidx5, align 4
61 %arrayidx7 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
62 %tmp3 = load i32, ptr %arrayidx7, align 4
66 %arrayidx10 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
67 %tmp4 = load i32, ptr %arrayidx10, align 4
70 for.inc: ; preds = %for.body
71 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
74 for.end: ; preds = %for.cond