1 ; RUN: opt < %s -adce -disable-output
2 ; RUN: opt < %s -adce -adce-remove-loops=true -disable-output
4 target datalayout = "e-p:32:32"
5 %struct..CppObjTypeDesc = type { i32, i16, i16 }
6 %struct..TypeToken = type { i32, i16, i16 }
8 define i32 @C_ReFaxToDb() {
10 br i1 false, label %endif.0, label %then.0
12 then.0: ; preds = %entry
15 endif.0: ; preds = %entry
16 br i1 false, label %then.11, label %then.4
18 then.4: ; preds = %endif.0
21 then.11: ; preds = %endif.0
22 br i1 false, label %loopentry.0, label %else.2
24 loopentry.0: ; preds = %loopentry.1, %endif.14, %then.11
25 br i1 false, label %endif.14, label %loopexit.0
27 endif.14: ; preds = %loopentry.0
28 br i1 false, label %loopentry.1, label %loopentry.0
30 loopentry.1: ; preds = %then.53, %endif.14
31 %SubArrays.10 = phi i32* [ %SubArrays.8, %then.53 ], [ null, %endif.14 ] ; <i32*> [#uses=3]
32 br i1 false, label %no_exit.1, label %loopentry.0
34 no_exit.1: ; preds = %loopentry.1
36 switch i32 0, label %label.17 [
37 i32 2, label %label.11
38 i32 19, label %label.10
41 label.10: ; preds = %no_exit.1
42 br i1 false, label %then.43, label %endif.43
44 then.43: ; preds = %label.10
45 br i1 false, label %then.44, label %endif.44
47 then.44: ; preds = %then.43
48 br i1 false, label %shortcirc_next.4, label %endif.45
50 shortcirc_next.4: ; preds = %then.44
51 br i1 false, label %no_exit.2, label %loopexit.2
53 no_exit.2: ; preds = %shortcirc_next.4
54 %tmp.897 = getelementptr i32, i32* %SubArrays.10, i64 0 ; <i32*> [#uses=1]
55 %tmp.899 = load i32, i32* %tmp.897 ; <i32> [#uses=1]
56 store i32 %tmp.899, i32* null
59 loopexit.2: ; preds = %shortcirc_next.4
62 endif.45: ; preds = %then.44
65 endif.44: ; preds = %then.43
68 endif.43: ; preds = %label.10
71 label.11: ; preds = %no_exit.1
74 label.17: ; preds = %no_exit.1
75 br i1 false, label %then.53, label %shortcirc_next.7
77 shortcirc_next.7: ; preds = %label.17
78 br i1 false, label %then.53, label %shortcirc_next.8
80 shortcirc_next.8: ; preds = %shortcirc_next.7
83 then.53: ; preds = %shortcirc_next.7, %label.17
84 %SubArrays.8 = phi i32* [ %SubArrays.10, %shortcirc_next.7 ], [ %SubArrays.10, %label.17 ] ; <i32*> [#uses=1]
85 %tmp.1023 = load i32, i32* null ; <i32> [#uses=1]
86 switch i32 %tmp.1023, label %loopentry.1 [
89 loopexit.0: ; preds = %loopentry.0
92 else.2: ; preds = %then.11