xref: /aosp_15_r20/external/llvm/test/Transforms/SimplifyCFG/2006-12-08-Ptr-ICmp-Branch.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -simplifycfg | llvm-dis
2*9880d681SAndroid Build Coastguard Worker; END.
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; ModuleID = '2006-12-08-Ptr-ICmp-Branch.ll'
5*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32"
6*9880d681SAndroid Build Coastguard Workertarget triple = "i686-pc-linux-gnu"
7*9880d681SAndroid Build Coastguard Worker	%struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
8*9880d681SAndroid Build Coastguard Worker	%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] }
9*9880d681SAndroid Build Coastguard Worker	%struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 }
10*9880d681SAndroid Build Coastguard Worker	%struct.charsequence = type { i8*, i32, i32 }
11*9880d681SAndroid Build Coastguard Worker	%struct.trie_s = type { [26 x %struct.trie_s*], i32 }
12*9880d681SAndroid Build Coastguard Worker@str = external global [14 x i8]		; <[14 x i8]*> [#uses=0]
13*9880d681SAndroid Build Coastguard Worker@str.upgrd.1 = external global [32 x i8]		; <[32 x i8]*> [#uses=0]
14*9880d681SAndroid Build Coastguard Worker@str.upgrd.2 = external global [12 x i8]		; <[12 x i8]*> [#uses=0]
15*9880d681SAndroid Build Coastguard Worker@C.0.2294 = external global %struct.charsequence		; <%struct.charsequence*> [#uses=3]
16*9880d681SAndroid Build Coastguard Worker@t = external global %struct.trie_s*		; <%struct.trie_s**> [#uses=0]
17*9880d681SAndroid Build Coastguard Worker@str.upgrd.3 = external global [3 x i8]		; <[3 x i8]*> [#uses=0]
18*9880d681SAndroid Build Coastguard Worker@str.upgrd.4 = external global [26 x i8]		; <[26 x i8]*> [#uses=0]
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerdeclare void @charsequence_reset(%struct.charsequence*)
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdeclare void @free(i8*)
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerdeclare void @charsequence_push(%struct.charsequence*, i8)
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Workerdeclare i8* @charsequence_val(%struct.charsequence*)
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerdeclare i32 @_IO_getc(%struct.FILE*)
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Workerdeclare i32 @tolower(i32)
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerdeclare %struct.trie_s* @trie_insert(%struct.trie_s*, i8*)
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Workerdeclare i32 @feof(%struct.FILE*)
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workerdefine void @addfile(%struct.trie_s* %t, %struct.FILE* %f) {
37*9880d681SAndroid Build Coastguard Workerentry:
38*9880d681SAndroid Build Coastguard Worker	%t_addr = alloca %struct.trie_s*		; <%struct.trie_s**> [#uses=2]
39*9880d681SAndroid Build Coastguard Worker	%f_addr = alloca %struct.FILE*		; <%struct.FILE**> [#uses=3]
40*9880d681SAndroid Build Coastguard Worker	%c = alloca i8, align 1		; <i8*> [#uses=7]
41*9880d681SAndroid Build Coastguard Worker	%wstate = alloca i32, align 4		; <i32*> [#uses=4]
42*9880d681SAndroid Build Coastguard Worker	%cs = alloca %struct.charsequence, align 16		; <%struct.charsequence*> [#uses=7]
43*9880d681SAndroid Build Coastguard Worker	%str = alloca i8*, align 4		; <i8**> [#uses=3]
44*9880d681SAndroid Build Coastguard Worker	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
45*9880d681SAndroid Build Coastguard Worker	store %struct.trie_s* %t, %struct.trie_s** %t_addr
46*9880d681SAndroid Build Coastguard Worker	store %struct.FILE* %f, %struct.FILE** %f_addr
47*9880d681SAndroid Build Coastguard Worker	store i32 0, i32* %wstate
48*9880d681SAndroid Build Coastguard Worker	%tmp = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 0		; <i8**> [#uses=1]
49*9880d681SAndroid Build Coastguard Worker	%tmp1 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 0		; <i8**> [#uses=1]
50*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.5 = load i8*, i8** %tmp1		; <i8*> [#uses=1]
51*9880d681SAndroid Build Coastguard Worker	store i8* %tmp.upgrd.5, i8** %tmp
52*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.6 = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 1		; <i32*> [#uses=1]
53*9880d681SAndroid Build Coastguard Worker	%tmp2 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 1		; <i32*> [#uses=1]
54*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.7 = load i32, i32* %tmp2		; <i32> [#uses=1]
55*9880d681SAndroid Build Coastguard Worker	store i32 %tmp.upgrd.7, i32* %tmp.upgrd.6
56*9880d681SAndroid Build Coastguard Worker	%tmp3 = getelementptr %struct.charsequence, %struct.charsequence* %cs, i64 0, i32 2		; <i32*> [#uses=1]
57*9880d681SAndroid Build Coastguard Worker	%tmp4 = getelementptr %struct.charsequence, %struct.charsequence* @C.0.2294, i64 0, i32 2		; <i32*> [#uses=1]
58*9880d681SAndroid Build Coastguard Worker	%tmp5 = load i32, i32* %tmp4		; <i32> [#uses=1]
59*9880d681SAndroid Build Coastguard Worker	store i32 %tmp5, i32* %tmp3
60*9880d681SAndroid Build Coastguard Worker	br label %bb33
61*9880d681SAndroid Build Coastguard Workerbb:		; preds = %bb33
62*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.8 = load %struct.FILE*, %struct.FILE** %f_addr		; <%struct.FILE*> [#uses=1]
63*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.9 = call i32 @_IO_getc( %struct.FILE* %tmp.upgrd.8 )		; <i32> [#uses=1]
64*9880d681SAndroid Build Coastguard Worker	%tmp6 = call i32 @tolower( i32 %tmp.upgrd.9 )		; <i32> [#uses=1]
65*9880d681SAndroid Build Coastguard Worker	%tmp6.upgrd.10 = trunc i32 %tmp6 to i8		; <i8> [#uses=1]
66*9880d681SAndroid Build Coastguard Worker	store i8 %tmp6.upgrd.10, i8* %c
67*9880d681SAndroid Build Coastguard Worker	%tmp7 = load i32, i32* %wstate		; <i32> [#uses=1]
68*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.11 = icmp ne i32 %tmp7, 0		; <i1> [#uses=1]
69*9880d681SAndroid Build Coastguard Worker	br i1 %tmp.upgrd.11, label %cond_true, label %cond_false
70*9880d681SAndroid Build Coastguard Workercond_true:		; preds = %bb
71*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.12 = load i8, i8* %c		; <i8> [#uses=1]
72*9880d681SAndroid Build Coastguard Worker	%tmp8 = icmp sle i8 %tmp.upgrd.12, 96		; <i1> [#uses=1]
73*9880d681SAndroid Build Coastguard Worker	br i1 %tmp8, label %cond_true9, label %cond_next
74*9880d681SAndroid Build Coastguard Workercond_true9:		; preds = %cond_true
75*9880d681SAndroid Build Coastguard Worker	br label %bb16
76*9880d681SAndroid Build Coastguard Workercond_next:		; preds = %cond_true
77*9880d681SAndroid Build Coastguard Worker	%tmp10 = load i8, i8* %c		; <i8> [#uses=1]
78*9880d681SAndroid Build Coastguard Worker	%tmp11 = icmp sgt i8 %tmp10, 122		; <i1> [#uses=1]
79*9880d681SAndroid Build Coastguard Worker	br i1 %tmp11, label %cond_true12, label %cond_next13
80*9880d681SAndroid Build Coastguard Workercond_true12:		; preds = %cond_next
81*9880d681SAndroid Build Coastguard Worker	br label %bb16
82*9880d681SAndroid Build Coastguard Workercond_next13:		; preds = %cond_next
83*9880d681SAndroid Build Coastguard Worker	%tmp14 = load i8, i8* %c		; <i8> [#uses=1]
84*9880d681SAndroid Build Coastguard Worker	%tmp14.upgrd.13 = sext i8 %tmp14 to i32		; <i32> [#uses=1]
85*9880d681SAndroid Build Coastguard Worker	%tmp1415 = trunc i32 %tmp14.upgrd.13 to i8		; <i8> [#uses=1]
86*9880d681SAndroid Build Coastguard Worker	call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp1415 )
87*9880d681SAndroid Build Coastguard Worker	br label %bb21
88*9880d681SAndroid Build Coastguard Workerbb16:		; preds = %cond_true12, %cond_true9
89*9880d681SAndroid Build Coastguard Worker	%tmp17 = call i8* @charsequence_val( %struct.charsequence* %cs )		; <i8*> [#uses=1]
90*9880d681SAndroid Build Coastguard Worker	store i8* %tmp17, i8** %str
91*9880d681SAndroid Build Coastguard Worker	%tmp.upgrd.14 = load %struct.trie_s*, %struct.trie_s** %t_addr		; <%struct.trie_s*> [#uses=1]
92*9880d681SAndroid Build Coastguard Worker	%tmp18 = load i8*, i8** %str		; <i8*> [#uses=1]
93*9880d681SAndroid Build Coastguard Worker	%tmp19 = call %struct.trie_s* @trie_insert( %struct.trie_s* %tmp.upgrd.14, i8* %tmp18 )		; <%struct.trie_s*> [#uses=0]
94*9880d681SAndroid Build Coastguard Worker	%tmp20 = load i8*, i8** %str		; <i8*> [#uses=1]
95*9880d681SAndroid Build Coastguard Worker	call void @free( i8* %tmp20 )
96*9880d681SAndroid Build Coastguard Worker	store i32 0, i32* %wstate
97*9880d681SAndroid Build Coastguard Worker	br label %bb21
98*9880d681SAndroid Build Coastguard Workerbb21:		; preds = %bb16, %cond_next13
99*9880d681SAndroid Build Coastguard Worker	br label %cond_next32
100*9880d681SAndroid Build Coastguard Workercond_false:		; preds = %bb
101*9880d681SAndroid Build Coastguard Worker	%tmp22 = load i8, i8* %c		; <i8> [#uses=1]
102*9880d681SAndroid Build Coastguard Worker	%tmp23 = icmp sgt i8 %tmp22, 96		; <i1> [#uses=1]
103*9880d681SAndroid Build Coastguard Worker	br i1 %tmp23, label %cond_true24, label %cond_next31
104*9880d681SAndroid Build Coastguard Workercond_true24:		; preds = %cond_false
105*9880d681SAndroid Build Coastguard Worker	%tmp25 = load i8, i8* %c		; <i8> [#uses=1]
106*9880d681SAndroid Build Coastguard Worker	%tmp26 = icmp sle i8 %tmp25, 122		; <i1> [#uses=1]
107*9880d681SAndroid Build Coastguard Worker	br i1 %tmp26, label %cond_true27, label %cond_next30
108*9880d681SAndroid Build Coastguard Workercond_true27:		; preds = %cond_true24
109*9880d681SAndroid Build Coastguard Worker	call void @charsequence_reset( %struct.charsequence* %cs )
110*9880d681SAndroid Build Coastguard Worker	%tmp28 = load i8, i8* %c		; <i8> [#uses=1]
111*9880d681SAndroid Build Coastguard Worker	%tmp28.upgrd.15 = sext i8 %tmp28 to i32		; <i32> [#uses=1]
112*9880d681SAndroid Build Coastguard Worker	%tmp2829 = trunc i32 %tmp28.upgrd.15 to i8		; <i8> [#uses=1]
113*9880d681SAndroid Build Coastguard Worker	call void @charsequence_push( %struct.charsequence* %cs, i8 %tmp2829 )
114*9880d681SAndroid Build Coastguard Worker	store i32 1, i32* %wstate
115*9880d681SAndroid Build Coastguard Worker	br label %cond_next30
116*9880d681SAndroid Build Coastguard Workercond_next30:		; preds = %cond_true27, %cond_true24
117*9880d681SAndroid Build Coastguard Worker	br label %cond_next31
118*9880d681SAndroid Build Coastguard Workercond_next31:		; preds = %cond_next30, %cond_false
119*9880d681SAndroid Build Coastguard Worker	br label %cond_next32
120*9880d681SAndroid Build Coastguard Workercond_next32:		; preds = %cond_next31, %bb21
121*9880d681SAndroid Build Coastguard Worker	br label %bb33
122*9880d681SAndroid Build Coastguard Workerbb33:		; preds = %cond_next32, %entry
123*9880d681SAndroid Build Coastguard Worker	%tmp34 = load %struct.FILE*, %struct.FILE** %f_addr		; <%struct.FILE*> [#uses=1]
124*9880d681SAndroid Build Coastguard Worker	%tmp35 = call i32 @feof( %struct.FILE* %tmp34 )		; <i32> [#uses=1]
125*9880d681SAndroid Build Coastguard Worker	%tmp36 = icmp eq i32 %tmp35, 0		; <i1> [#uses=1]
126*9880d681SAndroid Build Coastguard Worker	br i1 %tmp36, label %bb, label %bb37
127*9880d681SAndroid Build Coastguard Workerbb37:		; preds = %bb33
128*9880d681SAndroid Build Coastguard Worker	br label %return
129*9880d681SAndroid Build Coastguard Workerreturn:		; preds = %bb37
130*9880d681SAndroid Build Coastguard Worker	ret void
131*9880d681SAndroid Build Coastguard Worker}
132