1 ; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s
3 ; Test case to trigger the hard way of creating a unique entering
4 ; edge for the SCoP. It is triggered because the entering edge
5 ; here: %while.begin --> %if is __not__ critical.
8 ; void jd(int b, int *A) {
11 ; for (int i = 0; i < 1024; i++)
16 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
18 define void @jd(i32 %b, ptr %A) {
22 ; CHECK-LABEL: while.begin.region_exiting:
23 ; CHECK: br label %polly.merge_new_and_old
25 ; CHECK-LABEL: while.begin:
27 ; CHECK: %call = call i32 @f()
29 ; CHECK: %tobool = icmp eq i32 %call, 0
30 %tobool = icmp eq i32 %call, 0
31 ; CHECK: br i1 %tobool, label %while.end, label %polly.split_new_and_old
32 br i1 %tobool, label %while.end, label %if
34 ; CHECK: polly.split_new_and_old:
35 ; CHECK: br i1 true, label %polly.start, label %if
38 if: ; preds = %while.begin
39 ; CHECK: %tobool2 = icmp eq i32 %b, 0
40 %tobool2 = icmp eq i32 %b, 0
41 ; CHECK: br i1 %tobool2, label %while.begin{{[a-zA-Z._]*}}, label %for.cond
42 br i1 %tobool2, label %while.begin, label %for.cond
44 for.cond: ; preds = %for.inc, %if
45 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %if ]
46 %exitcond = icmp ne i64 %indvars.iv, 1024
47 br i1 %exitcond, label %for.body, label %while.begin
49 for.body: ; preds = %for.cond
50 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
51 %tmp = trunc i64 %indvars.iv to i32
52 store i32 %tmp, ptr %arrayidx, align 4
55 for.inc: ; preds = %for.body
56 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
59 while.end: ; preds = %entry, %for.cond