1 ; RUN: opt %loadPolly -polly-codegen < %s
3 ; Check we do not crash even though there is a dead load that is referenced by
4 ; a parameter and we do not pre-load it (as it is dead).
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8 @REGISTER = external global [10 x i32], align 16
10 ; Function Attrs: nounwind uwtable
11 define void @FORMAT3_4() #0 {
13 %INSTR = alloca [32 x i32], align 16
16 entry.split: ; preds = %entry
17 %0 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @REGISTER, i64 0, i64 8), align 16
18 %add = add nsw i32 %0, 2
19 %cmp = icmp sgt i32 %add, 1048575
20 br i1 %cmp, label %if.end.36, label %if.else
22 if.else: ; preds = %entry.split
23 call void (i32, i32, ptr, ...) @BYTES_TO_BITS(i32 undef, i32 1, ptr undef) #2
24 %1 = load i32, ptr undef, align 4
25 %cmp14 = icmp eq i32 %1, 1
26 br i1 %cmp14, label %land.lhs.true, label %if.end.36
28 land.lhs.true: ; preds = %if.else
29 %arrayidx16 = getelementptr inbounds [32 x i32], ptr %INSTR, i64 0, i64 6
30 br i1 false, label %land.lhs.true.19, label %if.then.23
32 land.lhs.true.19: ; preds = %land.lhs.true
33 %arrayidx20 = getelementptr inbounds [32 x i32], ptr %INSTR, i64 0, i64 7
34 br i1 false, label %if.end.36, label %if.then.23
36 if.then.23: ; preds = %land.lhs.true.19, %land.lhs.true
37 br i1 false, label %if.end.36, label %if.else.28
39 if.else.28: ; preds = %if.then.23
42 if.end.36: ; preds = %if.else.28, %if.then.23, %land.lhs.true.19, %if.else, %entry.split
43 %RANGE_ERROR.0 = phi i1 [ false, %land.lhs.true.19 ], [ false, %if.else.28 ], [ false, %if.else ], [ true, %entry.split ], [ true, %if.then.23 ]
44 br i1 %RANGE_ERROR.0, label %if.then.37, label %if.end.38
46 if.then.37: ; preds = %if.end.36
49 if.end.38: ; preds = %if.end.36
50 br i1 undef, label %land.lhs.true.43, label %if.else.50
52 land.lhs.true.43: ; preds = %if.end.38
53 br i1 undef, label %if.then.47, label %if.else.50
55 if.then.47: ; preds = %land.lhs.true.43
58 if.else.50: ; preds = %land.lhs.true.43, %if.end.38
59 br i1 undef, label %if.then.53, label %if.else.89
61 if.then.53: ; preds = %if.else.50
62 br i1 undef, label %land.lhs.true.59, label %if.end.64
64 land.lhs.true.59: ; preds = %if.then.53
65 br i1 undef, label %if.then.63, label %if.end.64
67 if.then.63: ; preds = %land.lhs.true.59
70 if.end.64: ; preds = %land.lhs.true.59, %if.then.53
71 br i1 undef, label %if.then.80, label %if.end.107
73 if.then.80: ; preds = %if.end.64
74 br i1 undef, label %if.then.83, label %if.else.85
76 if.then.83: ; preds = %if.then.80
79 if.else.85: ; preds = %if.then.80
82 if.else.89: ; preds = %if.else.50
83 br i1 undef, label %if.then.96, label %lor.lhs.false
85 lor.lhs.false: ; preds = %if.else.89
86 br i1 undef, label %if.then.96, label %if.end.97
88 if.then.96: ; preds = %lor.lhs.false, %if.else.89
91 if.end.97: ; preds = %lor.lhs.false
92 br i1 undef, label %if.then.103, label %if.end.107
94 if.then.103: ; preds = %if.end.97
97 if.end.107: ; preds = %if.then.103, %if.end.97, %if.else.85, %if.then.83, %if.end.64, %if.then.47
98 br i1 undef, label %land.lhs.true.111, label %if.end.142
100 land.lhs.true.111: ; preds = %if.end.107
101 br i1 undef, label %if.then.115, label %if.end.142
103 if.then.115: ; preds = %land.lhs.true.111
104 br i1 undef, label %if.then.118, label %return
106 if.then.118: ; preds = %if.then.115
107 br i1 undef, label %if.then.125, label %for.cond.preheader
109 for.cond.preheader: ; preds = %if.then.118
110 br i1 undef, label %for.body.lr.ph, label %for.end
112 for.body.lr.ph: ; preds = %for.cond.preheader
115 if.then.125: ; preds = %if.then.118
118 for.body: ; preds = %for.body, %for.body.lr.ph
119 br i1 undef, label %for.body, label %for.cond.for.end_crit_edge
121 for.cond.for.end_crit_edge: ; preds = %for.body
124 for.end: ; preds = %for.cond.for.end_crit_edge, %for.cond.preheader
127 if.end.142: ; preds = %land.lhs.true.111, %if.end.107
128 br i1 undef, label %land.lhs.true.146, label %if.end.206
130 land.lhs.true.146: ; preds = %if.end.142
131 br i1 undef, label %if.then.150, label %if.end.206
133 if.then.150: ; preds = %land.lhs.true.146
134 br i1 undef, label %if.then.157, label %lor.lhs.false.153
136 lor.lhs.false.153: ; preds = %if.then.150
137 br i1 undef, label %if.then.157, label %if.end.158
139 if.then.157: ; preds = %lor.lhs.false.153, %if.then.150
142 if.end.158: ; preds = %lor.lhs.false.153
143 br i1 undef, label %if.then.179, label %return
145 if.then.179: ; preds = %if.end.158
146 br i1 undef, label %if.then.183, label %for.cond.185.preheader
148 for.cond.185.preheader: ; preds = %if.then.179
149 br i1 undef, label %for.body.188.lr.ph, label %for.end.198
151 for.body.188.lr.ph: ; preds = %for.cond.185.preheader
152 br label %for.body.188
154 if.then.183: ; preds = %if.then.179
157 for.body.188: ; preds = %for.body.188, %for.body.188.lr.ph
158 br i1 undef, label %for.body.188, label %for.cond.185.for.end.198_crit_edge
160 for.cond.185.for.end.198_crit_edge: ; preds = %for.body.188
161 br label %for.end.198
163 for.end.198: ; preds = %for.cond.185.for.end.198_crit_edge, %for.cond.185.preheader
166 if.end.206: ; preds = %land.lhs.true.146, %if.end.142
167 br i1 undef, label %land.lhs.true.210, label %return
169 land.lhs.true.210: ; preds = %if.end.206
170 br i1 undef, label %if.then.214, label %return
172 if.then.214: ; preds = %land.lhs.true.210
173 br i1 undef, label %if.then.219, label %return
175 if.then.219: ; preds = %if.then.214
178 return: ; preds = %if.then.219, %if.then.214, %land.lhs.true.210, %if.end.206, %for.end.198, %if.then.183, %if.end.158, %if.then.157, %for.end, %if.then.125, %if.then.115, %if.then.96, %if.then.63, %if.then.37
182 declare void @BYTES_TO_BITS(...) #1
184 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="haswell" "target-features"="+aes,+avx,+avx2,+bmi,+bmi2,+cmov,+cx16,+f16c,+fma,+fsgsbase,+fxsr,+hle,+lzcnt,+mmx,+movbe,+pclmul,+popcnt,+rdrnd,+rtm,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+xsave,+xsaveopt,-adx,-avx512bw,-avx512cd,-avx512dq,-avx512er,-avx512f,-avx512pf,-avx512vl,-fma4,-prfchw,-rdseed,-sha,-sse4a,-tbm,-xop,-xsavec,-xsaves" "unsafe-fp-math"="false" "use-soft-float"="false" }
185 attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="haswell" "target-features"="+aes,+avx,+avx2,+bmi,+bmi2,+cmov,+cx16,+f16c,+fma,+fsgsbase,+fxsr,+hle,+lzcnt,+mmx,+movbe,+pclmul,+popcnt,+rdrnd,+rtm,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+xsave,+xsaveopt,-adx,-avx512bw,-avx512cd,-avx512dq,-avx512er,-avx512f,-avx512pf,-avx512vl,-fma4,-prfchw,-rdseed,-sha,-sse4a,-tbm,-xop,-xsavec,-xsaves" "unsafe-fp-math"="false" "use-soft-float"="false" }
186 attributes #2 = { nounwind }