1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 < %s | FileCheck %s
3 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-isel < %s | FileCheck --check-prefix=CHECK-NO-ISEL %s
4 target datalayout = "E-m:e-i64:64-n32:64"
5 target triple = "powerpc64-unknown-linux-gnu"
7 ; Function Attrs: nounwind
8 define void @jbd2_journal_commit_transaction(ptr %journal, i64 %inp1, i32 %inp2,
9 ; CHECK-LABEL: jbd2_journal_commit_transaction:
10 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: stw 12, 8(1)
14 ; CHECK-NEXT: stdu 1, -176(1)
15 ; CHECK-NEXT: lbz 6, 295(1)
16 ; CHECK-NEXT: std 0, 192(1)
17 ; CHECK-NEXT: andi. 6, 6, 1
18 ; CHECK-NEXT: std 25, 120(1) # 8-byte Folded Spill
19 ; CHECK-NEXT: std 26, 128(1) # 8-byte Folded Spill
20 ; CHECK-NEXT: std 27, 136(1) # 8-byte Folded Spill
21 ; CHECK-NEXT: std 28, 144(1) # 8-byte Folded Spill
22 ; CHECK-NEXT: std 29, 152(1) # 8-byte Folded Spill
23 ; CHECK-NEXT: std 30, 160(1) # 8-byte Folded Spill
24 ; CHECK-NEXT: crmove 9, 1
25 ; CHECK-NEXT: andi. 6, 10, 1
26 ; CHECK-NEXT: crmove 8, 1
27 ; CHECK-NEXT: andi. 6, 9, 1
28 ; CHECK-NEXT: bc 4, 20, .LBB0_24
29 ; CHECK-NEXT: # %bb.1: # %do.body
30 ; CHECK-NEXT: bc 4, 20, .LBB0_25
31 ; CHECK-NEXT: # %bb.2: # %trace_jbd2_start_commit.exit
32 ; CHECK-NEXT: mr 30, 8
33 ; CHECK-NEXT: mr 29, 7
34 ; CHECK-NEXT: bc 12, 20, .LBB0_4
35 ; CHECK-NEXT: # %bb.3: # %do.body.i1116
36 ; CHECK-NEXT: bc 4, 20, .LBB0_26
37 ; CHECK-NEXT: .LBB0_4: # %trace_jbd2_commit_locking.exit
38 ; CHECK-NEXT: bc 4, 20, .LBB0_27
39 ; CHECK-NEXT: # %bb.5: # %spin_unlock.exit1146
40 ; CHECK-NEXT: bc 4, 20, .LBB0_28
41 ; CHECK-NEXT: # %bb.6: # %trace_jbd2_commit_flushing.exit
42 ; CHECK-NEXT: bc 4, 20, .LBB0_29
43 ; CHECK-NEXT: # %bb.7: # %for.end.i
44 ; CHECK-NEXT: bc 4, 20, .LBB0_31
45 ; CHECK-NEXT: # %bb.8: # %journal_submit_data_buffers.exit
46 ; CHECK-NEXT: bc 4, 20, .LBB0_32
47 ; CHECK-NEXT: # %bb.9: # %if.end103
48 ; CHECK-NEXT: bc 4, 20, .LBB0_33
49 ; CHECK-NEXT: # %bb.10: # %trace_jbd2_commit_logging.exit
50 ; CHECK-NEXT: bc 4, 20, .LBB0_34
51 ; CHECK-NEXT: # %bb.11: # %for.end.i1287
52 ; CHECK-NEXT: bc 4, 20, .LBB0_35
53 ; CHECK-NEXT: # %bb.12: # %journal_finish_inode_data_buffers.exit
54 ; CHECK-NEXT: bc 4, 20, .LBB0_36
55 ; CHECK-NEXT: # %bb.13: # %if.end256
56 ; CHECK-NEXT: cmpdi 1, 4, 0
57 ; CHECK-NEXT: .p2align 4
58 ; CHECK-NEXT: .LBB0_14: # %while.body318
60 ; CHECK-NEXT: bc 4, 6, .LBB0_19
61 ; CHECK-NEXT: # %bb.15: # %wait_on_buffer.exit
63 ; CHECK-NEXT: bc 4, 1, .LBB0_14
64 ; CHECK-NEXT: # %bb.16: # %do.body378
65 ; CHECK-NEXT: bc 4, 8, .LBB0_20
66 ; CHECK-NEXT: # %bb.17: # %while.end418
67 ; CHECK-NEXT: bc 4, 8, .LBB0_23
68 ; CHECK-NEXT: .LBB0_18: # %if.end421
69 ; CHECK-NEXT: .LBB0_19: # %if.then.i1296
70 ; CHECK-NEXT: .LBB0_20: # %while.body392.lr.ph
71 ; CHECK-NEXT: lis 26, 4
72 ; CHECK-NEXT: mr 27, 5
73 ; CHECK-NEXT: mr 28, 3
74 ; CHECK-NEXT: .p2align 4
75 ; CHECK-NEXT: .LBB0_21: # %while.body392
77 ; CHECK-NEXT: ld 3, 0(3)
78 ; CHECK-NEXT: ldu 25, -72(3)
81 ; CHECK-NEXT: .long 2088769704
82 ; CHECK-NEXT: andc 4, 4, 26
83 ; CHECK-NEXT: stdcx. 4, 0, 3
84 ; CHECK-NEXT: bne- 0, .Ltmp0
87 ; CHECK-NEXT: ld 3, 0(29)
88 ; CHECK-NEXT: std 3, 0(30)
89 ; CHECK-NEXT: bl __brelse
91 ; CHECK-NEXT: bc 4, 9, .LBB0_21
92 ; CHECK-NEXT: # %bb.22: # %while.end418.loopexit
93 ; CHECK-NEXT: andi. 3, 25, 1
94 ; CHECK-NEXT: li 3, -5
95 ; CHECK-NEXT: mr 5, 27
96 ; CHECK-NEXT: iselgt 5, 5, 3
97 ; CHECK-NEXT: mr 3, 28
98 ; CHECK-NEXT: bc 12, 8, .LBB0_18
99 ; CHECK-NEXT: .LBB0_23: # %if.then420
100 ; CHECK-NEXT: extsw 4, 5
101 ; CHECK-NEXT: bl jbd2_journal_abort
103 ; CHECK-NEXT: .LBB0_24: # %if.then5
104 ; CHECK-NEXT: .LBB0_25: # %do.body.i
105 ; CHECK-NEXT: .LBB0_26: # %do.body5.i1122
106 ; CHECK-NEXT: .LBB0_27: # %if.then.i.i.i.i1144
107 ; CHECK-NEXT: .LBB0_28: # %do.body.i1159
108 ; CHECK-NEXT: .LBB0_29: # %for.body.lr.ph.i
109 ; CHECK-NEXT: bc 4, 20, .LBB0_37
110 ; CHECK-NEXT: # %bb.30: # %spin_unlock.exit.i
111 ; CHECK-NEXT: .LBB0_31: # %if.then.i.i.i.i31.i
112 ; CHECK-NEXT: .LBB0_32: # %if.then102
113 ; CHECK-NEXT: .LBB0_33: # %do.body.i1182
114 ; CHECK-NEXT: .LBB0_34: # %for.body.i1277
115 ; CHECK-NEXT: .LBB0_35: # %if.then.i.i.i.i84.i
116 ; CHECK-NEXT: .LBB0_36: # %if.then249
117 ; CHECK-NEXT: .LBB0_37: # %if.then.i.i.i.i.i
119 ; CHECK-NO-ISEL-LABEL: jbd2_journal_commit_transaction:
120 ; CHECK-NO-ISEL: # %bb.0: # %entry
121 ; CHECK-NO-ISEL-NEXT: mfcr 12
122 ; CHECK-NO-ISEL-NEXT: mflr 0
123 ; CHECK-NO-ISEL-NEXT: stw 12, 8(1)
124 ; CHECK-NO-ISEL-NEXT: stdu 1, -176(1)
125 ; CHECK-NO-ISEL-NEXT: lbz 6, 295(1)
126 ; CHECK-NO-ISEL-NEXT: std 0, 192(1)
127 ; CHECK-NO-ISEL-NEXT: andi. 6, 6, 1
128 ; CHECK-NO-ISEL-NEXT: std 25, 120(1) # 8-byte Folded Spill
129 ; CHECK-NO-ISEL-NEXT: std 26, 128(1) # 8-byte Folded Spill
130 ; CHECK-NO-ISEL-NEXT: std 27, 136(1) # 8-byte Folded Spill
131 ; CHECK-NO-ISEL-NEXT: std 28, 144(1) # 8-byte Folded Spill
132 ; CHECK-NO-ISEL-NEXT: std 29, 152(1) # 8-byte Folded Spill
133 ; CHECK-NO-ISEL-NEXT: std 30, 160(1) # 8-byte Folded Spill
134 ; CHECK-NO-ISEL-NEXT: crmove 9, 1
135 ; CHECK-NO-ISEL-NEXT: andi. 6, 10, 1
136 ; CHECK-NO-ISEL-NEXT: crmove 8, 1
137 ; CHECK-NO-ISEL-NEXT: andi. 6, 9, 1
138 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_26
139 ; CHECK-NO-ISEL-NEXT: # %bb.1: # %do.body
140 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_27
141 ; CHECK-NO-ISEL-NEXT: # %bb.2: # %trace_jbd2_start_commit.exit
142 ; CHECK-NO-ISEL-NEXT: mr 30, 8
143 ; CHECK-NO-ISEL-NEXT: mr 29, 7
144 ; CHECK-NO-ISEL-NEXT: bc 12, 20, .LBB0_4
145 ; CHECK-NO-ISEL-NEXT: # %bb.3: # %do.body.i1116
146 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_28
147 ; CHECK-NO-ISEL-NEXT: .LBB0_4: # %trace_jbd2_commit_locking.exit
148 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_29
149 ; CHECK-NO-ISEL-NEXT: # %bb.5: # %spin_unlock.exit1146
150 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_30
151 ; CHECK-NO-ISEL-NEXT: # %bb.6: # %trace_jbd2_commit_flushing.exit
152 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_31
153 ; CHECK-NO-ISEL-NEXT: # %bb.7: # %for.end.i
154 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_33
155 ; CHECK-NO-ISEL-NEXT: # %bb.8: # %journal_submit_data_buffers.exit
156 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_34
157 ; CHECK-NO-ISEL-NEXT: # %bb.9: # %if.end103
158 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_35
159 ; CHECK-NO-ISEL-NEXT: # %bb.10: # %trace_jbd2_commit_logging.exit
160 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_36
161 ; CHECK-NO-ISEL-NEXT: # %bb.11: # %for.end.i1287
162 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_37
163 ; CHECK-NO-ISEL-NEXT: # %bb.12: # %journal_finish_inode_data_buffers.exit
164 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_38
165 ; CHECK-NO-ISEL-NEXT: # %bb.13: # %if.end256
166 ; CHECK-NO-ISEL-NEXT: cmpdi 1, 4, 0
167 ; CHECK-NO-ISEL-NEXT: .p2align 4
168 ; CHECK-NO-ISEL-NEXT: .LBB0_14: # %while.body318
169 ; CHECK-NO-ISEL-NEXT: #
170 ; CHECK-NO-ISEL-NEXT: bc 4, 6, .LBB0_19
171 ; CHECK-NO-ISEL-NEXT: # %bb.15: # %wait_on_buffer.exit
172 ; CHECK-NO-ISEL-NEXT: #
173 ; CHECK-NO-ISEL-NEXT: bc 4, 1, .LBB0_14
174 ; CHECK-NO-ISEL-NEXT: # %bb.16: # %do.body378
175 ; CHECK-NO-ISEL-NEXT: bc 4, 8, .LBB0_20
176 ; CHECK-NO-ISEL-NEXT: # %bb.17: # %while.end418
177 ; CHECK-NO-ISEL-NEXT: bc 4, 8, .LBB0_25
178 ; CHECK-NO-ISEL-NEXT: .LBB0_18: # %if.end421
179 ; CHECK-NO-ISEL-NEXT: .LBB0_19: # %if.then.i1296
180 ; CHECK-NO-ISEL-NEXT: .LBB0_20: # %while.body392.lr.ph
181 ; CHECK-NO-ISEL-NEXT: lis 26, 4
182 ; CHECK-NO-ISEL-NEXT: mr 27, 5
183 ; CHECK-NO-ISEL-NEXT: mr 28, 3
184 ; CHECK-NO-ISEL-NEXT: .p2align 4
185 ; CHECK-NO-ISEL-NEXT: .LBB0_21: # %while.body392
186 ; CHECK-NO-ISEL-NEXT: #
187 ; CHECK-NO-ISEL-NEXT: ld 3, 0(3)
188 ; CHECK-NO-ISEL-NEXT: ldu 25, -72(3)
189 ; CHECK-NO-ISEL-NEXT: #APP
190 ; CHECK-NO-ISEL-NEXT: .Ltmp0:
191 ; CHECK-NO-ISEL-NEXT: .long 2088769704
192 ; CHECK-NO-ISEL-NEXT: andc 4, 4, 26
193 ; CHECK-NO-ISEL-NEXT: stdcx. 4, 0, 3
194 ; CHECK-NO-ISEL-NEXT: bne- 0, .Ltmp0
195 ; CHECK-NO-ISEL-EMPTY:
196 ; CHECK-NO-ISEL-NEXT: #NO_APP
197 ; CHECK-NO-ISEL-NEXT: ld 3, 0(29)
198 ; CHECK-NO-ISEL-NEXT: std 3, 0(30)
199 ; CHECK-NO-ISEL-NEXT: bl __brelse
200 ; CHECK-NO-ISEL-NEXT: nop
201 ; CHECK-NO-ISEL-NEXT: bc 4, 9, .LBB0_21
202 ; CHECK-NO-ISEL-NEXT: # %bb.22: # %while.end418.loopexit
203 ; CHECK-NO-ISEL-NEXT: andi. 3, 25, 1
204 ; CHECK-NO-ISEL-NEXT: mr 5, 27
205 ; CHECK-NO-ISEL-NEXT: bc 12, 1, .LBB0_24
206 ; CHECK-NO-ISEL-NEXT: # %bb.23: # %while.end418.loopexit
207 ; CHECK-NO-ISEL-NEXT: li 5, -5
208 ; CHECK-NO-ISEL-NEXT: .LBB0_24: # %while.end418.loopexit
209 ; CHECK-NO-ISEL-NEXT: mr 3, 28
210 ; CHECK-NO-ISEL-NEXT: bc 12, 8, .LBB0_18
211 ; CHECK-NO-ISEL-NEXT: .LBB0_25: # %if.then420
212 ; CHECK-NO-ISEL-NEXT: extsw 4, 5
213 ; CHECK-NO-ISEL-NEXT: bl jbd2_journal_abort
214 ; CHECK-NO-ISEL-NEXT: nop
215 ; CHECK-NO-ISEL-NEXT: .LBB0_26: # %if.then5
216 ; CHECK-NO-ISEL-NEXT: .LBB0_27: # %do.body.i
217 ; CHECK-NO-ISEL-NEXT: .LBB0_28: # %do.body5.i1122
218 ; CHECK-NO-ISEL-NEXT: .LBB0_29: # %if.then.i.i.i.i1144
219 ; CHECK-NO-ISEL-NEXT: .LBB0_30: # %do.body.i1159
220 ; CHECK-NO-ISEL-NEXT: .LBB0_31: # %for.body.lr.ph.i
221 ; CHECK-NO-ISEL-NEXT: bc 4, 20, .LBB0_39
222 ; CHECK-NO-ISEL-NEXT: # %bb.32: # %spin_unlock.exit.i
223 ; CHECK-NO-ISEL-NEXT: .LBB0_33: # %if.then.i.i.i.i31.i
224 ; CHECK-NO-ISEL-NEXT: .LBB0_34: # %if.then102
225 ; CHECK-NO-ISEL-NEXT: .LBB0_35: # %do.body.i1182
226 ; CHECK-NO-ISEL-NEXT: .LBB0_36: # %for.body.i1277
227 ; CHECK-NO-ISEL-NEXT: .LBB0_37: # %if.then.i.i.i.i84.i
228 ; CHECK-NO-ISEL-NEXT: .LBB0_38: # %if.then249
229 ; CHECK-NO-ISEL-NEXT: .LBB0_39: # %if.then.i.i.i.i.i
230 ptr %inp3, ptr %inp4,
232 i1 %inp7, i1 %inp8) #0 {
234 br i1 undef, label %do.body, label %if.then5
236 if.then5: ; preds = %entry
239 do.body: ; preds = %entry
240 br i1 undef, label %do.body.i, label %trace_jbd2_start_commit.exit
242 do.body.i: ; preds = %do.body
245 trace_jbd2_start_commit.exit: ; preds = %do.body
246 br i1 undef, label %do.body.i1116, label %trace_jbd2_commit_locking.exit
248 do.body.i1116: ; preds = %trace_jbd2_start_commit.exit
249 br i1 undef, label %if.end.i1123, label %do.body5.i1122
251 do.body5.i1122: ; preds = %do.body.i1116
254 if.end.i1123: ; preds = %do.body.i1116
255 br label %trace_jbd2_commit_locking.exit
257 trace_jbd2_commit_locking.exit: ; preds = %if.end.i1123, %trace_jbd2_start_commit.exit
258 br i1 undef, label %spin_unlock.exit1146, label %if.then.i.i.i.i1144
260 if.then.i.i.i.i1144: ; preds = %trace_jbd2_commit_locking.exit
263 spin_unlock.exit1146: ; preds = %trace_jbd2_commit_locking.exit
264 br i1 undef, label %spin_unlock.exit1154, label %if.then.i.i.i.i1152
266 if.then.i.i.i.i1152: ; preds = %spin_unlock.exit1146
267 br label %spin_unlock.exit1154
269 spin_unlock.exit1154: ; preds = %if.then.i.i.i.i1152, %spin_unlock.exit1146
270 br i1 undef, label %do.body.i1159, label %trace_jbd2_commit_flushing.exit
272 do.body.i1159: ; preds = %spin_unlock.exit1154
275 trace_jbd2_commit_flushing.exit: ; preds = %spin_unlock.exit1154
276 br i1 undef, label %for.end.i, label %for.body.lr.ph.i
278 for.body.lr.ph.i: ; preds = %trace_jbd2_commit_flushing.exit
279 br i1 undef, label %spin_unlock.exit.i, label %if.then.i.i.i.i.i
281 if.then.i.i.i.i.i: ; preds = %for.body.lr.ph.i
284 spin_unlock.exit.i: ; preds = %for.body.lr.ph.i
287 for.end.i: ; preds = %trace_jbd2_commit_flushing.exit
288 br i1 undef, label %journal_submit_data_buffers.exit, label %if.then.i.i.i.i31.i
290 if.then.i.i.i.i31.i: ; preds = %for.end.i
293 journal_submit_data_buffers.exit: ; preds = %for.end.i
294 br i1 undef, label %if.end103, label %if.then102
296 if.then102: ; preds = %journal_submit_data_buffers.exit
299 if.end103: ; preds = %journal_submit_data_buffers.exit
300 br i1 undef, label %do.body.i1182, label %trace_jbd2_commit_logging.exit
302 do.body.i1182: ; preds = %if.end103
305 trace_jbd2_commit_logging.exit: ; preds = %if.end103
306 br i1 undef, label %for.end.i1287, label %for.body.i1277
308 for.body.i1277: ; preds = %trace_jbd2_commit_logging.exit
311 for.end.i1287: ; preds = %trace_jbd2_commit_logging.exit
312 br i1 undef, label %journal_finish_inode_data_buffers.exit, label %if.then.i.i.i.i84.i
314 if.then.i.i.i.i84.i: ; preds = %for.end.i1287
317 journal_finish_inode_data_buffers.exit: ; preds = %for.end.i1287
318 br i1 undef, label %if.end256, label %if.then249
320 if.then249: ; preds = %journal_finish_inode_data_buffers.exit
323 if.end256: ; preds = %journal_finish_inode_data_buffers.exit
324 br i1 undef, label %do.body277, label %if.then260
326 if.then260: ; preds = %if.end256
329 do.body277: ; preds = %if.then260, %if.end256
330 br label %while.body318
332 while.body318: ; preds = %wait_on_buffer.exit, %do.body277
333 %tobool.i1295 = icmp eq i64 %inp1, 0
334 br i1 %tobool.i1295, label %wait_on_buffer.exit, label %if.then.i1296
336 if.then.i1296: ; preds = %while.body318
339 wait_on_buffer.exit: ; preds = %while.body318
340 br i1 %inp6, label %do.body378, label %while.body318
342 do.body378: ; preds = %wait_on_buffer.exit
343 br i1 %inp7, label %while.end418, label %while.body392.lr.ph
345 while.body392.lr.ph: ; preds = %do.body378
346 br label %while.body392
348 while.body392: ; preds = %wait_on_buffer.exit1319, %while.body392.lr.ph
349 %0 = load ptr, ptr undef, align 8
350 %add.ptr399 = getelementptr inbounds i8, ptr %0, i64 -72
351 %tobool.i1316 = icmp eq i64 %inp1, 0
352 br i1 %tobool.i1316, label %wait_on_buffer.exit1319, label %if.then.i1317
354 if.then.i1317: ; preds = %while.body392
357 wait_on_buffer.exit1319: ; preds = %while.body392
358 %1 = load volatile i64, ptr %add.ptr399, align 8
359 %conv.i.i1322 = and i64 %1, 1
360 %lnot404 = icmp eq i64 %conv.i.i1322, 0
361 %.err.4 = select i1 %lnot404, i32 -5, i32 %inp2
362 %2 = call i64 asm sideeffect "1:.long 0x7c0000a8 $| ((($0) & 0x1f) << 21) $| (((0) & 0x1f) << 16) $| ((($3) & 0x1f) << 11) $| (((0) & 0x1) << 0) \0Aandc $0,$0,$2\0Astdcx. $0,0,$3\0Abne- 1b\0A", "=&r,=*m,r,r,*m,~{cc},~{memory}"(ptr elementtype(i64) %add.ptr399, i64 262144, ptr %add.ptr399, ptr elementtype(i64) %add.ptr399) #1
363 %prev.i.i.i1325 = getelementptr inbounds i8, ptr %0, i64 8
364 %3 = load ptr, ptr %inp4, align 8
365 store ptr %3, ptr %inp5, align 8
366 call void @__brelse(ptr %3) #1
367 br i1 %inp8, label %while.end418, label %while.body392
371 while.end418: ; preds = %wait_on_buffer.exit1319, %do.body378
372 %err.4.lcssa = phi i32 [ %inp2, %do.body378 ], [ %.err.4, %wait_on_buffer.exit1319 ]
373 br i1 %inp7, label %if.end421, label %if.then420
375 if.then420: ; preds = %while.end418
376 call void @jbd2_journal_abort(ptr %journal, i32 signext %err.4.lcssa) #1
379 if.end421: ; preds = %if.then420, %while.end418
383 declare void @jbd2_journal_abort(ptr, i32 signext)
385 declare void @__brelse(ptr)
387 attributes #0 = { nounwind }
388 attributes #1 = { nounwind }