1; RUN: opt %loadPolly -S -polly-codegen -verify-loop-info < %s | FileCheck %s
2;
3; Check that we do not crash as described here: http://llvm.org/bugs/show_bug.cgi?id=21167
4;
5; CHECK: polly.split_new_and_old
6;
7target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8
9; Function Attrs: nounwind uwtable
10define void @kernel_fdtd_apml(i32 %cxm, i32 %cym, [65 x [65 x double]]* %Bza, [65 x [65 x double]]* %Hz, double* %czp) #0 {
11entry:
12  br i1 false, label %for.cond4.preheader, label %for.end451
13
14for.cond4.preheader:                              ; preds = %for.inc449, %entry
15  %iz.08 = phi i32 [ undef, %for.inc449 ], [ 0, %entry ]
16  %cmp55 = icmp sgt i32 %cym, 0
17  br i1 %cmp55, label %for.cond7.preheader, label %for.inc449
18
19for.cond7.preheader:                              ; preds = %for.end, %for.cond4.preheader
20  %iy.06 = phi i32 [ %inc447, %for.end ], [ 0, %for.cond4.preheader ]
21  %cmp81 = icmp sgt i32 %cxm, 0
22  br i1 %cmp81, label %for.body9, label %for.end
23
24for.body9:                                        ; preds = %for.body9, %for.cond7.preheader
25  %ix.02 = phi i32 [ %inc, %for.body9 ], [ 0, %for.cond7.preheader ]
26  %idxprom74 = sext i32 %iz.08 to i64
27  %arrayidx75 = getelementptr inbounds double, double* %czp, i64 %idxprom74
28  %0 = load double, double* %arrayidx75, align 8
29  %idxprom102 = sext i32 %iz.08 to i64
30  %arrayidx105 = getelementptr inbounds [65 x [65 x double]], [65 x [65 x double]]* %Hz, i64 %idxprom102, i64 0, i64 0
31  store double undef, double* %arrayidx105, align 8
32  %inc = add nsw i32 %ix.02, 1
33  br i1 false, label %for.body9, label %for.end
34
35for.end:                                          ; preds = %for.body9, %for.cond7.preheader
36  %idxprom209 = sext i32 %cxm to i64
37  %idxprom211 = sext i32 %iz.08 to i64
38  %arrayidx214 = getelementptr inbounds [65 x [65 x double]], [65 x [65 x double]]* %Hz, i64 %idxprom211, i64 0, i64 %idxprom209
39  store double undef, double* %arrayidx214, align 8
40  %idxprom430 = sext i32 %cxm to i64
41  %idxprom431 = sext i32 %cym to i64
42  %idxprom432 = sext i32 %iz.08 to i64
43  %arrayidx435 = getelementptr inbounds [65 x [65 x double]], [65 x [65 x double]]* %Hz, i64 %idxprom432, i64 %idxprom431, i64 %idxprom430
44  store double undef, double* %arrayidx435, align 8
45  %arrayidx445 = getelementptr inbounds [65 x [65 x double]], [65 x [65 x double]]* %Bza, i64 0, i64 0, i64 0
46  store double undef, double* %arrayidx445, align 8
47  %inc447 = add nsw i32 %iy.06, 1
48  %cmp5 = icmp slt i32 %inc447, %cym
49  br i1 %cmp5, label %for.cond7.preheader, label %for.inc449
50
51for.inc449:                                       ; preds = %for.end, %for.cond4.preheader
52  br i1 undef, label %for.cond4.preheader, label %for.end451
53
54for.end451:                                       ; preds = %for.inc449, %entry
55  ret void
56}
57