blob: b9f17465d00349f172cc576dd223155aa82bfd26 [file] [log] [blame]
Hal Finkelaa10b3c2014-12-08 22:54:22 +00001; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
2target datalayout = "E-m:e-i64:64-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5; Function Attrs: nounwind
Ehsan Amiri4701a912016-04-07 15:30:55 +00006define void @jbd2_journal_commit_transaction(i32* %journal, i64 %inp1, i32 %inp2,
7 i32* %inp3, i32** %inp4,
8 i32** %inp5, i1 %inp6,
9 i1 %inp7, i1 %inp8) #0 {
Hal Finkelaa10b3c2014-12-08 22:54:22 +000010entry:
11 br i1 undef, label %do.body, label %if.then5
12
13if.then5: ; preds = %entry
14 unreachable
15
16do.body: ; preds = %entry
17 br i1 undef, label %do.body.i, label %trace_jbd2_start_commit.exit
18
19do.body.i: ; preds = %do.body
20 unreachable
21
22trace_jbd2_start_commit.exit: ; preds = %do.body
23 br i1 undef, label %do.body.i1116, label %trace_jbd2_commit_locking.exit
24
25do.body.i1116: ; preds = %trace_jbd2_start_commit.exit
26 br i1 undef, label %if.end.i1123, label %do.body5.i1122
27
28do.body5.i1122: ; preds = %do.body.i1116
29 unreachable
30
31if.end.i1123: ; preds = %do.body.i1116
32 br label %trace_jbd2_commit_locking.exit
33
34trace_jbd2_commit_locking.exit: ; preds = %if.end.i1123, %trace_jbd2_start_commit.exit
35 br i1 undef, label %spin_unlock.exit1146, label %if.then.i.i.i.i1144
36
37if.then.i.i.i.i1144: ; preds = %trace_jbd2_commit_locking.exit
38 unreachable
39
40spin_unlock.exit1146: ; preds = %trace_jbd2_commit_locking.exit
41 br i1 undef, label %spin_unlock.exit1154, label %if.then.i.i.i.i1152
42
43if.then.i.i.i.i1152: ; preds = %spin_unlock.exit1146
44 br label %spin_unlock.exit1154
45
46spin_unlock.exit1154: ; preds = %if.then.i.i.i.i1152, %spin_unlock.exit1146
47 br i1 undef, label %do.body.i1159, label %trace_jbd2_commit_flushing.exit
48
49do.body.i1159: ; preds = %spin_unlock.exit1154
50 unreachable
51
52trace_jbd2_commit_flushing.exit: ; preds = %spin_unlock.exit1154
53 br i1 undef, label %for.end.i, label %for.body.lr.ph.i
54
55for.body.lr.ph.i: ; preds = %trace_jbd2_commit_flushing.exit
56 br i1 undef, label %spin_unlock.exit.i, label %if.then.i.i.i.i.i
57
58if.then.i.i.i.i.i: ; preds = %for.body.lr.ph.i
59 unreachable
60
61spin_unlock.exit.i: ; preds = %for.body.lr.ph.i
62 unreachable
63
64for.end.i: ; preds = %trace_jbd2_commit_flushing.exit
65 br i1 undef, label %journal_submit_data_buffers.exit, label %if.then.i.i.i.i31.i
66
67if.then.i.i.i.i31.i: ; preds = %for.end.i
68 unreachable
69
70journal_submit_data_buffers.exit: ; preds = %for.end.i
71 br i1 undef, label %if.end103, label %if.then102
72
73if.then102: ; preds = %journal_submit_data_buffers.exit
74 unreachable
75
76if.end103: ; preds = %journal_submit_data_buffers.exit
77 br i1 undef, label %do.body.i1182, label %trace_jbd2_commit_logging.exit
78
79do.body.i1182: ; preds = %if.end103
80 unreachable
81
82trace_jbd2_commit_logging.exit: ; preds = %if.end103
83 br i1 undef, label %for.end.i1287, label %for.body.i1277
84
85for.body.i1277: ; preds = %trace_jbd2_commit_logging.exit
86 unreachable
87
88for.end.i1287: ; preds = %trace_jbd2_commit_logging.exit
89 br i1 undef, label %journal_finish_inode_data_buffers.exit, label %if.then.i.i.i.i84.i
90
91if.then.i.i.i.i84.i: ; preds = %for.end.i1287
92 unreachable
93
94journal_finish_inode_data_buffers.exit: ; preds = %for.end.i1287
95 br i1 undef, label %if.end256, label %if.then249
96
97if.then249: ; preds = %journal_finish_inode_data_buffers.exit
98 unreachable
99
100if.end256: ; preds = %journal_finish_inode_data_buffers.exit
101 br i1 undef, label %do.body277, label %if.then260
102
103if.then260: ; preds = %if.end256
104 br label %do.body277
105
106do.body277: ; preds = %if.then260, %if.end256
107 br label %while.body318
108
109while.body318: ; preds = %wait_on_buffer.exit, %do.body277
Ehsan Amiri4701a912016-04-07 15:30:55 +0000110 %tobool.i1295 = icmp eq i64 %inp1, 0
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000111 br i1 %tobool.i1295, label %wait_on_buffer.exit, label %if.then.i1296
112
113if.then.i1296: ; preds = %while.body318
114 unreachable
115
116wait_on_buffer.exit: ; preds = %while.body318
Ehsan Amiri4701a912016-04-07 15:30:55 +0000117 br i1 %inp6, label %do.body378, label %while.body318
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000118
119do.body378: ; preds = %wait_on_buffer.exit
Ehsan Amiri4701a912016-04-07 15:30:55 +0000120 br i1 %inp7, label %while.end418, label %while.body392.lr.ph
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000121
122while.body392.lr.ph: ; preds = %do.body378
123 br label %while.body392
124
125while.body392: ; preds = %wait_on_buffer.exit1319, %while.body392.lr.ph
David Blaikiea79ac142015-02-27 21:17:42 +0000126 %0 = load i8*, i8** undef, align 8
David Blaikie79e6c742015-02-27 19:29:02 +0000127 %add.ptr399 = getelementptr inbounds i8, i8* %0, i64 -72
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000128 %b_state.i.i1314 = bitcast i8* %add.ptr399 to i64*
Ehsan Amiri4701a912016-04-07 15:30:55 +0000129 %tobool.i1316 = icmp eq i64 %inp1, 0
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000130 br i1 %tobool.i1316, label %wait_on_buffer.exit1319, label %if.then.i1317
131
132if.then.i1317: ; preds = %while.body392
133 unreachable
134
135wait_on_buffer.exit1319: ; preds = %while.body392
David Blaikiea79ac142015-02-27 21:17:42 +0000136 %1 = load volatile i64, i64* %b_state.i.i1314, align 8
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000137 %conv.i.i1322 = and i64 %1, 1
138 %lnot404 = icmp eq i64 %conv.i.i1322, 0
Ehsan Amiri4701a912016-04-07 15:30:55 +0000139 %.err.4 = select i1 %lnot404, i32 -5, i32 %inp2
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000140 %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}"(i64* %b_state.i.i1314, i64 262144, i64* %b_state.i.i1314, i64* %b_state.i.i1314) #1
David Blaikie79e6c742015-02-27 19:29:02 +0000141 %prev.i.i.i1325 = getelementptr inbounds i8, i8* %0, i64 8
Ehsan Amiri4701a912016-04-07 15:30:55 +0000142 %3 = load i32*, i32** %inp4, align 8
143 store i32* %3, i32** %inp5, align 8
144 call void @__brelse(i32* %3) #1
145 br i1 %inp8, label %while.end418, label %while.body392
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000146
147; CHECK-LABEL: @jbd2_journal_commit_transaction
148; CHECK: andi.
Ehsan Amiri4701a912016-04-07 15:30:55 +0000149; CHECK: crmove
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000150; CHECK: stdcx.
Ehsan Amiri4701a912016-04-07 15:30:55 +0000151; CHECK: isel {{[0-9]+}}, {{[0-9]+}}, {{[0-9]+}},
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000152
153while.end418: ; preds = %wait_on_buffer.exit1319, %do.body378
Ehsan Amiri4701a912016-04-07 15:30:55 +0000154 %err.4.lcssa = phi i32 [ %inp2, %do.body378 ], [ %.err.4, %wait_on_buffer.exit1319 ]
155 br i1 %inp7, label %if.end421, label %if.then420
Hal Finkelaa10b3c2014-12-08 22:54:22 +0000156
157if.then420: ; preds = %while.end418
158 call void @jbd2_journal_abort(i32* %journal, i32 signext %err.4.lcssa) #1
159 br label %if.end421
160
161if.end421: ; preds = %if.then420, %while.end418
162 unreachable
163}
164
165declare void @jbd2_journal_abort(i32*, i32 signext)
166
167declare void @__brelse(i32*)
168
169attributes #0 = { nounwind }
170attributes #1 = { nounwind }
171