1; RUN: opt %loadNPMPolly -passes=polly-codegen < %s
2;
3; Check we do not crash even though the dead %tmp8 is referenced by a parameter
4; and we do not pre-load it (as it is dead).
5;
6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7
8%struct.hoge = type { ptr, i32, i32, i32, ptr, ptr, %struct.barney, %struct.ham, %struct.wombat }
9%struct.widget = type { i32, i32, i32, i32, ptr }
10%struct.quux = type { ptr, i32, i32, i32, %struct.hoge.0 }
11%struct.hoge.0 = type { [2 x i64] }
12%struct.barney = type { ptr }
13%struct.ham = type { i32 }
14%struct.wombat = type { ptr }
15%struct.foo = type { ptr, ptr, i32, i32, i32, %struct.hoge.2, %struct.blam, %struct.wombat.5, i16, ptr, ptr, i16, ptr, i16, ptr, i16, ptr, i16, ptr, ptr, i16, ptr, ptr }
16%struct.wibble = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
17%struct.foo.1 = type { ptr, ptr, i32 }
18%struct.hoge.2 = type { i16, i16 }
19%struct.blam = type { i16, ptr }
20%struct.barney.3 = type { i8, %struct.foo.4 }
21%struct.foo.4 = type { i64 }
22%struct.wombat.5 = type { i16 }
23%struct.blam.6 = type <{ %struct.wombat.5, [6 x i8], ptr, ptr, i32, i16, [2 x i8] }>
24%struct.foo.7 = type { %struct.wombat.5, ptr, ptr, i8, i8, i32, ptr, i16, ptr, i16, ptr, i16, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr }
25%struct.bar = type { i32, i16, i16, %struct.wibble.8, i16, ptr }
26%struct.wibble.8 = type { i32 }
27%struct.barney.9 = type { i16, i16 }
28%struct.hoge.10 = type { i16, i16, i16, i16, i16 }
29%struct.bar.11 = type { i64, i64 }
30
31@global = external global i32, align 4
32@global1 = external global i32, align 4
33@global2 = external global ptr, align 8
34@global3 = external global ptr, align 8
35@global4 = external global ptr, align 8
36
37; Function Attrs: uwtable
38define i32 @foo(ptr %arg) #0 personality ptr @blam {
39bb:
40  br label %bb3
41
42bb3:                                              ; preds = %bb
43  %tmp = load i32, ptr @global, align 4, !tbaa !1
44  %tmp4 = add i32 %tmp, -1
45  %tmp5 = icmp eq i32 0, 0
46  br i1 %tmp5, label %bb12, label %bb6
47
48bb6:                                              ; preds = %bb3
49  br label %bb7
50
51bb7:                                              ; preds = %bb7, %bb6
52  %tmp8 = load i32, ptr @global, align 4, !tbaa !1
53  %tmp9 = and i32 %tmp8, 3
54  %tmp10 = icmp eq i32 %tmp9, 0
55  br i1 %tmp10, label %bb11, label %bb7
56
57bb11:                                             ; preds = %bb7
58  br label %bb12
59
60bb12:                                             ; preds = %bb11, %bb3
61  invoke void @zot(ptr nonnull undef, i32 %tmp4, i32 undef, i32 9, i32 0, i32 39, ptr undef, i32 undef, i32 undef, ptr nonnull undef)
62          to label %bb13 unwind label %bb17
63
64bb13:                                             ; preds = %bb12
65  br i1 undef, label %bb16, label %bb14
66
67bb14:                                             ; preds = %bb13
68  br label %bb19
69
70bb15:                                             ; preds = %bb19
71  br label %bb16
72
73bb16:                                             ; preds = %bb15, %bb13
74  ret i32 0
75
76bb17:                                             ; preds = %bb12
77  %tmp18 = landingpad { ptr, i32 }
78          cleanup
79  resume { ptr, i32 } %tmp18
80
81bb19:                                             ; preds = %bb19, %bb14
82  br i1 undef, label %bb15, label %bb19
83}
84
85; Function Attrs: argmemonly nounwind
86declare void @llvm.lifetime.start(i64, ptr nocapture) #1
87
88; Function Attrs: nounwind readnone
89declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2
90
91; Function Attrs: nobuiltin
92declare noalias ptr @eggs(i64) #3
93
94; Function Attrs: nobuiltin
95declare noalias ptr @bar(i64) #3
96
97; Function Attrs: uwtable
98declare void @zot(ptr, i32, i32, i32, i32, i32, ptr, i32, i32, ptr) unnamed_addr #0 align 2
99
100declare i32 @blam(...)
101
102; Function Attrs: nobuiltin nounwind
103declare void @zot5(ptr) #4
104
105; Function Attrs: argmemonly nounwind
106declare void @llvm.lifetime.end(i64, ptr nocapture) #1
107
108; Function Attrs: uwtable
109declare i32 @eggs6(ptr) #0
110
111; Function Attrs: nounwind uwtable
112declare void @eggs7(ptr, i32, i32, i32) unnamed_addr #5 align 2
113
114attributes #0 = { 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"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
115attributes #1 = { argmemonly nounwind }
116attributes #2 = { nounwind readnone }
117attributes #3 = { nobuiltin "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"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
118attributes #4 = { nobuiltin nounwind "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"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
119attributes #5 = { 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"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
120
121!llvm.ident = !{!0}
122
123!0 = !{!"clang version 3.8.0 (trunk 252700) (llvm/trunk 252705)"}
124!1 = !{!2, !2, i64 0}
125!2 = !{!"int", !3, i64 0}
126!3 = !{!"omnipotent char", !4, i64 0}
127!4 = !{!"Simple C/C++ TBAA"}
128