xref: /aosp_15_r20/external/llvm/test/CodeGen/Thumb2/2009-08-04-CoalescerBug.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker	%0 = type { %struct.GAP }		; type %0
4*9880d681SAndroid Build Coastguard Worker	%1 = type { i16, i8, i8 }		; type %1
5*9880d681SAndroid Build Coastguard Worker	%2 = type { [2 x i32], [2 x i32] }		; type %2
6*9880d681SAndroid Build Coastguard Worker	%3 = type { %struct.rec* }		; type %3
7*9880d681SAndroid Build Coastguard Worker	%4 = type { i8, i8, i16, i8, i8, i8, i8 }		; type %4
8*9880d681SAndroid Build Coastguard Worker	%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
9*9880d681SAndroid Build Coastguard Worker	%struct.FILE_POS = type { i8, i8, i16, i32 }
10*9880d681SAndroid Build Coastguard Worker	%struct.FIRST_UNION = type { %struct.FILE_POS }
11*9880d681SAndroid Build Coastguard Worker	%struct.FOURTH_UNION = type { %struct.STYLE }
12*9880d681SAndroid Build Coastguard Worker	%struct.GAP = type { i8, i8, i16 }
13*9880d681SAndroid Build Coastguard Worker	%struct.LIST = type { %struct.rec*, %struct.rec* }
14*9880d681SAndroid Build Coastguard Worker	%struct.SECOND_UNION = type { %1 }
15*9880d681SAndroid Build Coastguard Worker	%struct.STYLE = type { %0, %0, i16, i16, i32 }
16*9880d681SAndroid Build Coastguard Worker	%struct.THIRD_UNION = type { %2 }
17*9880d681SAndroid Build Coastguard Worker	%struct.__sFILEX = type opaque
18*9880d681SAndroid Build Coastguard Worker	%struct.__sbuf = type { i8*, i32 }
19*9880d681SAndroid Build Coastguard Worker	%struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, %3, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 }
20*9880d681SAndroid Build Coastguard Worker	%struct.rec = type { %struct.head_type }
21*9880d681SAndroid Build Coastguard Worker@.str24239 = external constant [20 x i8], align 1		; <[20 x i8]*> [#uses=1]
22*9880d681SAndroid Build Coastguard Worker@no_file_pos = external global %4		; <%4*> [#uses=1]
23*9880d681SAndroid Build Coastguard Worker@zz_tmp = external global %struct.rec*		; <%struct.rec**> [#uses=1]
24*9880d681SAndroid Build Coastguard Worker@.str81872 = external constant [10 x i8], align 1		; <[10 x i8]*> [#uses=1]
25*9880d681SAndroid Build Coastguard Worker@out_fp = external global %struct.FILE*		; <%struct.FILE**> [#uses=2]
26*9880d681SAndroid Build Coastguard Worker@cpexists = external global i32		; <i32*> [#uses=2]
27*9880d681SAndroid Build Coastguard Worker@.str212784 = external constant [17 x i8], align 1		; <[17 x i8]*> [#uses=1]
28*9880d681SAndroid Build Coastguard Worker@.str1822946 = external constant [8 x i8], align 1		; <[8 x i8]*> [#uses=1]
29*9880d681SAndroid Build Coastguard Worker@.str1842948 = external constant [11 x i8], align 1		; <[11 x i8]*> [#uses=1]
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard Workerdeclare i32 @fprintf(%struct.FILE* nocapture, i8* nocapture, ...) nounwind
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Workerdeclare i32 @"\01_fwrite"(i8*, i32, i32, i8*)
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Workerdeclare %struct.FILE* @OpenIncGraphicFile(i8*, i8 zeroext, %struct.rec** nocapture, %struct.FILE_POS*, i32* nocapture) nounwind
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Workerdeclare void @Error(i32, i32, i8*, i32, %struct.FILE_POS*, ...) nounwind
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Workerdeclare i8* @fgets(i8*, i32, %struct.FILE* nocapture) nounwind
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Workerdefine void @PS_PrintGraphicInclude(%struct.rec* %x, i32 %colmark, i32 %rowmark) nounwind {
42*9880d681SAndroid Build Coastguard Workerentry:
43*9880d681SAndroid Build Coastguard Worker	br label %bb5
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Workerbb5:		; preds = %bb5, %entry
46*9880d681SAndroid Build Coastguard Worker	%.pn = phi %struct.rec* [ %y.0, %bb5 ], [ undef, %entry ]		; <%struct.rec*> [#uses=1]
47*9880d681SAndroid Build Coastguard Worker	%y.0.in = getelementptr %struct.rec, %struct.rec* %.pn, i32 0, i32 0, i32 0, i32 1, i32 0		; <%struct.rec**> [#uses=1]
48*9880d681SAndroid Build Coastguard Worker	%y.0 = load %struct.rec*, %struct.rec** %y.0.in		; <%struct.rec*> [#uses=2]
49*9880d681SAndroid Build Coastguard Worker	br i1 undef, label %bb5, label %bb6
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Workerbb6:		; preds = %bb5
52*9880d681SAndroid Build Coastguard Worker	%0 = call  %struct.FILE* @OpenIncGraphicFile(i8* undef, i8 zeroext 0, %struct.rec** undef, %struct.FILE_POS* null, i32* undef) nounwind		; <%struct.FILE*> [#uses=1]
53*9880d681SAndroid Build Coastguard Worker	br i1 false, label %bb.i, label %FontHalfXHeight.exit
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Workerbb.i:		; preds = %bb6
56*9880d681SAndroid Build Coastguard Worker	br label %FontHalfXHeight.exit
57*9880d681SAndroid Build Coastguard Worker
58*9880d681SAndroid Build Coastguard WorkerFontHalfXHeight.exit:		; preds = %bb.i, %bb6
59*9880d681SAndroid Build Coastguard Worker	br i1 undef, label %bb.i1, label %FontSize.exit
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard Workerbb.i1:		; preds = %FontHalfXHeight.exit
62*9880d681SAndroid Build Coastguard Worker	br label %FontSize.exit
63*9880d681SAndroid Build Coastguard Worker
64*9880d681SAndroid Build Coastguard WorkerFontSize.exit:		; preds = %bb.i1, %FontHalfXHeight.exit
65*9880d681SAndroid Build Coastguard Worker	%1 = load i32, i32* undef, align 4		; <i32> [#uses=1]
66*9880d681SAndroid Build Coastguard Worker	%2 = icmp ult i32 0, undef		; <i1> [#uses=1]
67*9880d681SAndroid Build Coastguard Worker	br i1 %2, label %bb.i5, label %FontName.exit
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Workerbb.i5:		; preds = %FontSize.exit
70*9880d681SAndroid Build Coastguard Worker	call  void (i32, i32, i8*, i32, %struct.FILE_POS*, ...) @Error(i32 1, i32 2, i8* getelementptr ([20 x i8], [20 x i8]* @.str24239, i32 0, i32 0), i32 0, %struct.FILE_POS* bitcast (%4* @no_file_pos to %struct.FILE_POS*), i8* getelementptr ([10 x i8], [10 x i8]* @.str81872, i32 0, i32 0)) nounwind
71*9880d681SAndroid Build Coastguard Worker	br label %FontName.exit
72*9880d681SAndroid Build Coastguard Worker
73*9880d681SAndroid Build Coastguard WorkerFontName.exit:		; preds = %bb.i5, %FontSize.exit
74*9880d681SAndroid Build Coastguard Worker	%3 = call  i32 (%struct.FILE*, i8*, ...) @fprintf(%struct.FILE* undef, i8* getelementptr ([8 x i8], [8 x i8]* @.str1822946, i32 0, i32 0), i32 %1, i8* undef) nounwind		; <i32> [#uses=0]
75*9880d681SAndroid Build Coastguard Worker	%4 = call  i32 @"\01_fwrite"(i8* getelementptr ([11 x i8], [11 x i8]* @.str1842948, i32 0, i32 0), i32 1, i32 10, i8* undef) nounwind		; <i32> [#uses=0]
76*9880d681SAndroid Build Coastguard Worker	%5 = sub i32 %colmark, undef		; <i32> [#uses=1]
77*9880d681SAndroid Build Coastguard Worker	%6 = sub i32 %rowmark, undef		; <i32> [#uses=1]
78*9880d681SAndroid Build Coastguard Worker	%7 = load %struct.FILE*, %struct.FILE** @out_fp, align 4		; <%struct.FILE*> [#uses=1]
79*9880d681SAndroid Build Coastguard Worker	%8 = call  i32 (%struct.FILE*, i8*, ...) @fprintf(%struct.FILE* %7, i8* getelementptr ([17 x i8], [17 x i8]* @.str212784, i32 0, i32 0), i32 %5, i32 %6) nounwind		; <i32> [#uses=0]
80*9880d681SAndroid Build Coastguard Worker	store i32 0, i32* @cpexists, align 4
81*9880d681SAndroid Build Coastguard Worker	%9 = getelementptr %struct.rec, %struct.rec* %y.0, i32 0, i32 0, i32 3, i32 0, i32 0, i32 1		; <i32*> [#uses=1]
82*9880d681SAndroid Build Coastguard Worker	%10 = load i32, i32* %9, align 4		; <i32> [#uses=1]
83*9880d681SAndroid Build Coastguard Worker	%11 = sub i32 0, %10		; <i32> [#uses=1]
84*9880d681SAndroid Build Coastguard Worker	%12 = load %struct.FILE*, %struct.FILE** @out_fp, align 4		; <%struct.FILE*> [#uses=1]
85*9880d681SAndroid Build Coastguard Worker	%13 = call  i32 (%struct.FILE*, i8*, ...) @fprintf(%struct.FILE* %12, i8* getelementptr ([17 x i8], [17 x i8]* @.str212784, i32 0, i32 0), i32 undef, i32 %11) nounwind		; <i32> [#uses=0]
86*9880d681SAndroid Build Coastguard Worker	store i32 0, i32* @cpexists, align 4
87*9880d681SAndroid Build Coastguard Worker	br label %bb100.outer.outer
88*9880d681SAndroid Build Coastguard Worker
89*9880d681SAndroid Build Coastguard Workerbb100.outer.outer:		; preds = %bb79.critedge, %bb1.i3, %FontName.exit
90*9880d681SAndroid Build Coastguard Worker	%x_addr.0.ph.ph = phi %struct.rec* [ %x, %FontName.exit ], [ null, %bb79.critedge ], [ null, %bb1.i3 ]		; <%struct.rec*> [#uses=1]
91*9880d681SAndroid Build Coastguard Worker	%14 = getelementptr %struct.rec, %struct.rec* %x_addr.0.ph.ph, i32 0, i32 0, i32 1, i32 0		; <%struct.FILE_POS*> [#uses=0]
92*9880d681SAndroid Build Coastguard Worker	br label %bb100.outer
93*9880d681SAndroid Build Coastguard Worker
94*9880d681SAndroid Build Coastguard Workerbb.i80:		; preds = %bb3.i85
95*9880d681SAndroid Build Coastguard Worker	br i1 undef, label %bb2.i84, label %bb2.i51
96*9880d681SAndroid Build Coastguard Worker
97*9880d681SAndroid Build Coastguard Workerbb2.i84:		; preds = %bb100.outer, %bb.i80
98*9880d681SAndroid Build Coastguard Worker	br i1 undef, label %bb3.i77, label %bb3.i85
99*9880d681SAndroid Build Coastguard Worker
100*9880d681SAndroid Build Coastguard Workerbb3.i85:		; preds = %bb2.i84
101*9880d681SAndroid Build Coastguard Worker	br i1 false, label %StringBeginsWith.exit88, label %bb.i80
102*9880d681SAndroid Build Coastguard Worker
103*9880d681SAndroid Build Coastguard WorkerStringBeginsWith.exit88:		; preds = %bb3.i85
104*9880d681SAndroid Build Coastguard Worker	br i1 undef, label %bb3.i77, label %bb2.i51
105*9880d681SAndroid Build Coastguard Worker
106*9880d681SAndroid Build Coastguard Workerbb2.i.i68:		; preds = %bb3.i77
107*9880d681SAndroid Build Coastguard Worker	br label %bb3.i77
108*9880d681SAndroid Build Coastguard Worker
109*9880d681SAndroid Build Coastguard Workerbb3.i77:		; preds = %bb2.i.i68, %StringBeginsWith.exit88, %bb2.i84
110*9880d681SAndroid Build Coastguard Worker	br i1 false, label %bb1.i58, label %bb2.i.i68
111*9880d681SAndroid Build Coastguard Worker
112*9880d681SAndroid Build Coastguard Workerbb1.i58:		; preds = %bb3.i77
113*9880d681SAndroid Build Coastguard Worker	unreachable
114*9880d681SAndroid Build Coastguard Worker
115*9880d681SAndroid Build Coastguard Workerbb.i47:		; preds = %bb3.i52
116*9880d681SAndroid Build Coastguard Worker	br i1 undef, label %bb2.i51, label %bb2.i.i15.critedge
117*9880d681SAndroid Build Coastguard Worker
118*9880d681SAndroid Build Coastguard Workerbb2.i51:		; preds = %bb.i47, %StringBeginsWith.exit88, %bb.i80
119*9880d681SAndroid Build Coastguard Worker	%15 = load i8, i8* undef, align 1		; <i8> [#uses=0]
120*9880d681SAndroid Build Coastguard Worker	br i1 false, label %StringBeginsWith.exit55thread-split, label %bb3.i52
121*9880d681SAndroid Build Coastguard Worker
122*9880d681SAndroid Build Coastguard Workerbb3.i52:		; preds = %bb2.i51
123*9880d681SAndroid Build Coastguard Worker	br i1 false, label %StringBeginsWith.exit55, label %bb.i47
124*9880d681SAndroid Build Coastguard Worker
125*9880d681SAndroid Build Coastguard WorkerStringBeginsWith.exit55thread-split:		; preds = %bb2.i51
126*9880d681SAndroid Build Coastguard Worker	br label %StringBeginsWith.exit55
127*9880d681SAndroid Build Coastguard Worker
128*9880d681SAndroid Build Coastguard WorkerStringBeginsWith.exit55:		; preds = %StringBeginsWith.exit55thread-split, %bb3.i52
129*9880d681SAndroid Build Coastguard Worker	br label %bb2.i41
130*9880d681SAndroid Build Coastguard Worker
131*9880d681SAndroid Build Coastguard Workerbb2.i41:		; preds = %bb2.i41, %StringBeginsWith.exit55
132*9880d681SAndroid Build Coastguard Worker	br label %bb2.i41
133*9880d681SAndroid Build Coastguard Worker
134*9880d681SAndroid Build Coastguard Workerbb2.i.i15.critedge:		; preds = %bb.i47
135*9880d681SAndroid Build Coastguard Worker	%16 = call  i8* @fgets(i8* undef, i32 512, %struct.FILE* %0) nounwind		; <i8*> [#uses=0]
136*9880d681SAndroid Build Coastguard Worker	%iftmp.560.0 = select i1 undef, i32 2, i32 0		; <i32> [#uses=1]
137*9880d681SAndroid Build Coastguard Worker	br label %bb100.outer
138*9880d681SAndroid Build Coastguard Worker
139*9880d681SAndroid Build Coastguard Workerbb2.i8:		; preds = %bb100.outer
140*9880d681SAndroid Build Coastguard Worker	br i1 undef, label %bb1.i3, label %bb79.critedge
141*9880d681SAndroid Build Coastguard Worker
142*9880d681SAndroid Build Coastguard Workerbb1.i3:		; preds = %bb2.i8
143*9880d681SAndroid Build Coastguard Worker	br label %bb100.outer.outer
144*9880d681SAndroid Build Coastguard Worker
145*9880d681SAndroid Build Coastguard Workerbb79.critedge:		; preds = %bb2.i8
146*9880d681SAndroid Build Coastguard Worker	store %struct.rec* null, %struct.rec** @zz_tmp, align 4
147*9880d681SAndroid Build Coastguard Worker	br label %bb100.outer.outer
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Workerbb100.outer:		; preds = %bb2.i.i15.critedge, %bb100.outer.outer
150*9880d681SAndroid Build Coastguard Worker	%state.0.ph = phi i32 [ 0, %bb100.outer.outer ], [ %iftmp.560.0, %bb2.i.i15.critedge ]		; <i32> [#uses=1]
151*9880d681SAndroid Build Coastguard Worker	%cond = icmp eq i32 %state.0.ph, 1		; <i1> [#uses=1]
152*9880d681SAndroid Build Coastguard Worker	br i1 %cond, label %bb2.i8, label %bb2.i84
153*9880d681SAndroid Build Coastguard Worker}
154