xref: /llvm-project/llvm/test/CodeGen/X86/2008-05-12-tailmerge-5.ll (revision e9caa37e9c69f6a6e5ab59d33b9d492054819ded)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s | FileCheck %s
3; Calls to abort should all be merged
4
5; ModuleID = '5898899.c'
6target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
7target triple = "x86_64-apple-darwin8"
8	%struct.BoundaryAlignment = type { [3 x i8], i8, i16, i16, i8, [2 x i8] }
9
10define void @passing2(i64 %str.0, i64 %str.1, i16 signext  %s, i32 %j, i8 signext  %c, i16 signext  %t, i16 signext  %u, i8 signext  %d) nounwind optsize {
11; CHECK-LABEL: passing2:
12; CHECK:       ## %bb.0: ## %entry
13; CHECK-NEXT:    subq $40, %rsp
14; CHECK-NEXT:    movq %rsi, %rax
15; CHECK-NEXT:    movq %rdi, {{[0-9]+}}(%rsp)
16; CHECK-NEXT:    movb %al, {{[0-9]+}}(%rsp)
17; CHECK-NEXT:    movb %ah, {{[0-9]+}}(%rsp)
18; CHECK-NEXT:    shrq $16, %rax
19; CHECK-NEXT:    movb %al, {{[0-9]+}}(%rsp)
20; CHECK-NEXT:    movb %ah, {{[0-9]+}}(%rsp)
21; CHECK-NEXT:    movw %dx, {{[0-9]+}}(%rsp)
22; CHECK-NEXT:    movl %ecx, {{[0-9]+}}(%rsp)
23; CHECK-NEXT:    movb %r8b, {{[0-9]+}}(%rsp)
24; CHECK-NEXT:    movw %r9w, {{[0-9]+}}(%rsp)
25; CHECK-NEXT:    shll $14, %edi
26; CHECK-NEXT:    sarl $23, %edi
27; CHECK-NEXT:    cmpl %ecx, %edi
28; CHECK-NEXT:    jne LBB0_6
29; CHECK-NEXT:  ## %bb.1: ## %bb27
30; CHECK-NEXT:    movb {{[0-9]+}}(%rsp), %al
31; CHECK-NEXT:    cmpb {{[0-9]+}}(%rsp), %al
32; CHECK-NEXT:    jne LBB0_6
33; CHECK-NEXT:  ## %bb.2: ## %bb35
34; CHECK-NEXT:    movl {{[0-9]+}}(%rsp), %eax
35; CHECK-NEXT:    shll $7, %eax
36; CHECK-NEXT:    cwtl
37; CHECK-NEXT:    shrl $7, %eax
38; CHECK-NEXT:    cmpw {{[0-9]+}}(%rsp), %ax
39; CHECK-NEXT:    jne LBB0_6
40; CHECK-NEXT:  ## %bb.3: ## %bb51
41; CHECK-NEXT:    movl {{[0-9]+}}(%rsp), %eax
42; CHECK-NEXT:    shll $7, %eax
43; CHECK-NEXT:    cwtl
44; CHECK-NEXT:    shrl $7, %eax
45; CHECK-NEXT:    cmpw {{[0-9]+}}(%rsp), %ax
46; CHECK-NEXT:    jne LBB0_6
47; CHECK-NEXT:  ## %bb.4: ## %bb67
48; CHECK-NEXT:    movb {{[0-9]+}}(%rsp), %al
49; CHECK-NEXT:    cmpb {{[0-9]+}}(%rsp), %al
50; CHECK-NEXT:    jne LBB0_6
51; CHECK-NEXT:  ## %bb.5: ## %bb75
52; CHECK-NEXT:    addq $40, %rsp
53; CHECK-NEXT:    retq
54; CHECK-NEXT:  LBB0_6: ## %bb
55; CHECK-NEXT:    xorl %eax, %eax
56; CHECK-NEXT:    callq _abort
57entry:
58	%str_addr = alloca %struct.BoundaryAlignment		; <ptr> [#uses=7]
59	%s_addr = alloca i16		; <ptr> [#uses=1]
60	%j_addr = alloca i32		; <ptr> [#uses=2]
61	%c_addr = alloca i8		; <ptr> [#uses=2]
62	%t_addr = alloca i16		; <ptr> [#uses=2]
63	%u_addr = alloca i16		; <ptr> [#uses=2]
64	%d_addr = alloca i8		; <ptr> [#uses=2]
65	%"alloca point" = bitcast i32 0 to i32		; <i32> [#uses=0]
66	%tmp1 = getelementptr { i64, i64 }, ptr %str_addr, i32 0, i32 0		; <ptr> [#uses=1]
67	store i64 %str.0, ptr %tmp1
68	%tmp3 = getelementptr { i64, i64 }, ptr %str_addr, i32 0, i32 1		; <ptr> [#uses=1]
69	%byte = trunc i64 %str.1 to i8		; <i8> [#uses=1]
70	store i8 %byte, ptr %tmp3
71	%shft = lshr i64 %str.1, 8		; <i64> [#uses=2]
72	%Loc = getelementptr i8, ptr %tmp3, i32 1		; <ptr> [#uses=2]
73	%byte4 = trunc i64 %shft to i8		; <i8> [#uses=1]
74	store i8 %byte4, ptr %Loc
75	%shft5 = lshr i64 %shft, 8		; <i64> [#uses=2]
76	%Loc6 = getelementptr i8, ptr %Loc, i32 1		; <ptr> [#uses=2]
77	%byte7 = trunc i64 %shft5 to i8		; <i8> [#uses=1]
78	store i8 %byte7, ptr %Loc6
79	%shft8 = lshr i64 %shft5, 8		; <i64> [#uses=2]
80	%Loc9 = getelementptr i8, ptr %Loc6, i32 1		; <ptr> [#uses=2]
81	%byte10 = trunc i64 %shft8 to i8		; <i8> [#uses=1]
82	store i8 %byte10, ptr %Loc9
83	%shft11 = lshr i64 %shft8, 8		; <i64> [#uses=0]
84	%Loc12 = getelementptr i8, ptr %Loc9, i32 1		; <ptr> [#uses=0]
85	store i16 %s, ptr %s_addr
86	store i32 %j, ptr %j_addr
87	store i8 %c, ptr %c_addr
88	store i16 %t, ptr %t_addr
89	store i16 %u, ptr %u_addr
90	store i8 %d, ptr %d_addr
91	%tmp13 = getelementptr %struct.BoundaryAlignment, ptr %str_addr, i32 0, i32 0		; <ptr> [#uses=1]
92	%tmp15 = load i32, ptr %tmp13, align 4		; <i32> [#uses=1]
93	%tmp16 = shl i32 %tmp15, 14		; <i32> [#uses=1]
94	%tmp17 = ashr i32 %tmp16, 23		; <i32> [#uses=1]
95	%tmp1718 = trunc i32 %tmp17 to i16		; <i16> [#uses=1]
96	%sextl = shl i16 %tmp1718, 7		; <i16> [#uses=1]
97	%sextr = ashr i16 %sextl, 7		; <i16> [#uses=2]
98	%sextl19 = shl i16 %sextr, 7		; <i16> [#uses=1]
99	%sextr20 = ashr i16 %sextl19, 7		; <i16> [#uses=0]
100	%sextl21 = shl i16 %sextr, 7		; <i16> [#uses=1]
101	%sextr22 = ashr i16 %sextl21, 7		; <i16> [#uses=1]
102	%sextr2223 = sext i16 %sextr22 to i32		; <i32> [#uses=1]
103	%tmp24 = load i32, ptr %j_addr, align 4		; <i32> [#uses=1]
104	%tmp25 = icmp ne i32 %sextr2223, %tmp24		; <i1> [#uses=1]
105	%tmp2526 = zext i1 %tmp25 to i8		; <i8> [#uses=1]
106	%toBool = icmp ne i8 %tmp2526, 0		; <i1> [#uses=1]
107	br i1 %toBool, label %bb, label %bb27
108
109bb:		; preds = %entry
110	call void (...) @abort( ) noreturn nounwind
111	unreachable
112
113bb27:		; preds = %entry
114	%tmp28 = getelementptr %struct.BoundaryAlignment, ptr %str_addr, i32 0, i32 1		; <ptr> [#uses=1]
115	%tmp29 = load i8, ptr %tmp28, align 4		; <i8> [#uses=1]
116	%tmp30 = load i8, ptr %c_addr, align 1		; <i8> [#uses=1]
117	%tmp31 = icmp ne i8 %tmp29, %tmp30		; <i1> [#uses=1]
118	%tmp3132 = zext i1 %tmp31 to i8		; <i8> [#uses=1]
119	%toBool33 = icmp ne i8 %tmp3132, 0		; <i1> [#uses=1]
120	br i1 %toBool33, label %bb34, label %bb35
121
122bb34:		; preds = %bb27
123	call void (...) @abort( ) noreturn nounwind
124	unreachable
125
126bb35:		; preds = %bb27
127	%tmp36 = getelementptr %struct.BoundaryAlignment, ptr %str_addr, i32 0, i32 2		; <ptr> [#uses=1]
128	%tmp37 = load i16, ptr %tmp36, align 4		; <i16> [#uses=1]
129	%tmp38 = shl i16 %tmp37, 7		; <i16> [#uses=1]
130	%tmp39 = ashr i16 %tmp38, 7		; <i16> [#uses=1]
131	%sextl40 = shl i16 %tmp39, 7		; <i16> [#uses=1]
132	%sextr41 = ashr i16 %sextl40, 7		; <i16> [#uses=2]
133	%sextl42 = shl i16 %sextr41, 7		; <i16> [#uses=1]
134	%sextr43 = ashr i16 %sextl42, 7		; <i16> [#uses=0]
135	%sextl44 = shl i16 %sextr41, 7		; <i16> [#uses=1]
136	%sextr45 = ashr i16 %sextl44, 7		; <i16> [#uses=1]
137	%tmp46 = load i16, ptr %t_addr, align 2		; <i16> [#uses=1]
138	%tmp47 = icmp ne i16 %sextr45, %tmp46		; <i1> [#uses=1]
139	%tmp4748 = zext i1 %tmp47 to i8		; <i8> [#uses=1]
140	%toBool49 = icmp ne i8 %tmp4748, 0		; <i1> [#uses=1]
141	br i1 %toBool49, label %bb50, label %bb51
142
143bb50:		; preds = %bb35
144	call void (...) @abort( ) noreturn nounwind
145	unreachable
146
147bb51:		; preds = %bb35
148	%tmp52 = getelementptr %struct.BoundaryAlignment, ptr %str_addr, i32 0, i32 3		; <ptr> [#uses=1]
149	%tmp53 = load i16, ptr %tmp52, align 4		; <i16> [#uses=1]
150	%tmp54 = shl i16 %tmp53, 7		; <i16> [#uses=1]
151	%tmp55 = ashr i16 %tmp54, 7		; <i16> [#uses=1]
152	%sextl56 = shl i16 %tmp55, 7		; <i16> [#uses=1]
153	%sextr57 = ashr i16 %sextl56, 7		; <i16> [#uses=2]
154	%sextl58 = shl i16 %sextr57, 7		; <i16> [#uses=1]
155	%sextr59 = ashr i16 %sextl58, 7		; <i16> [#uses=0]
156	%sextl60 = shl i16 %sextr57, 7		; <i16> [#uses=1]
157	%sextr61 = ashr i16 %sextl60, 7		; <i16> [#uses=1]
158	%tmp62 = load i16, ptr %u_addr, align 2		; <i16> [#uses=1]
159	%tmp63 = icmp ne i16 %sextr61, %tmp62		; <i1> [#uses=1]
160	%tmp6364 = zext i1 %tmp63 to i8		; <i8> [#uses=1]
161	%toBool65 = icmp ne i8 %tmp6364, 0		; <i1> [#uses=1]
162	br i1 %toBool65, label %bb66, label %bb67
163
164bb66:		; preds = %bb51
165	call void (...) @abort( ) noreturn nounwind
166	unreachable
167
168bb67:		; preds = %bb51
169	%tmp68 = getelementptr %struct.BoundaryAlignment, ptr %str_addr, i32 0, i32 4		; <ptr> [#uses=1]
170	%tmp69 = load i8, ptr %tmp68, align 4		; <i8> [#uses=1]
171	%tmp70 = load i8, ptr %d_addr, align 1		; <i8> [#uses=1]
172	%tmp71 = icmp ne i8 %tmp69, %tmp70		; <i1> [#uses=1]
173	%tmp7172 = zext i1 %tmp71 to i8		; <i8> [#uses=1]
174	%toBool73 = icmp ne i8 %tmp7172, 0		; <i1> [#uses=1]
175	br i1 %toBool73, label %bb74, label %bb75
176
177bb74:		; preds = %bb67
178	call void (...) @abort( ) noreturn nounwind
179	unreachable
180
181bb75:		; preds = %bb67
182	br label %return
183
184return:		; preds = %bb75
185	ret void
186}
187
188declare void @abort(...) noreturn nounwind
189