1 ; RUN: opt %loadPolly -polly-print-scops -disable-output< %s | FileCheck %s
3 ; void f(int *A, int c, int d) {
4 ; for (int i = 0; i < 1024; i++)
9 ; Verify that we do not generate a value write access for the use of %cmp1 in
10 ; the branch condition. As _affine_ branches are fully modeled and regenerated
11 ; from the polyhedral information we do not need this value to be available
12 ; during code generation.
14 ; CHECK-NOT: Stmt_for_cond[i0] -> MemRef_cmp1[] }
16 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
18 define void @f(ptr %A, i64 %c) {
22 for.cond: ; preds = %for.inc, %entry
23 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
24 %exitcond = icmp ne i64 %indvars.iv, 1024
25 %cmp1 = icmp slt i64 %c, %indvars.iv
26 br i1 %exitcond, label %for.body, label %for.end
28 for.body: ; preds = %for.cond
29 br i1 %cmp1, label %if.then, label %if.end
31 if.then: ; preds = %for.body
32 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
33 %tmp = load i32, ptr %arrayidx, align 4
34 %inc = add nsw i32 %tmp, 1
35 store i32 %inc, ptr %arrayidx, align 4
38 if.end: ; preds = %if.then, %for.body
41 for.inc: ; preds = %if.end
42 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
45 for.end: ; preds = %for.cond