1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S -mtriple=riscv64-unknown-linux-gnu -slp-threshold=-100 -mattr=+v < %s | FileCheck %s
4 define void @test1() personality ptr null {
5 ; CHECK-LABEL: define void @test1(
6 ; CHECK-SAME: ) #[[ATTR0:[0-9]+]] personality ptr null {
8 ; CHECK-NEXT: [[CALL33:%.*]] = invoke ptr null(i64 0, ptr null)
9 ; CHECK-NEXT: to label [[INVOKE_CONT32:%.*]] unwind label [[LPAD31_LOOPEXIT:%.*]]
10 ; CHECK: invoke.cont32:
11 ; CHECK-NEXT: invoke void null(ptr null, ptr null)
12 ; CHECK-NEXT: to label [[INVOKE_CONT37:%.*]] unwind label [[LPAD34_LOOPEXIT:%.*]]
13 ; CHECK: invoke.cont37:
14 ; CHECK-NEXT: unreachable
15 ; CHECK: lpad31.loopexit:
16 ; CHECK-NEXT: [[LPAD_LOOPEXIT:%.*]] = landingpad { ptr, i32 }
18 ; CHECK-NEXT: br label [[EHCLEANUP47:%.*]]
19 ; CHECK: lpad34.loopexit:
20 ; CHECK-NEXT: [[DOTLCSSA101:%.*]] = phi ptr [ null, [[INVOKE_CONT32]] ]
21 ; CHECK-NEXT: [[CALL33_LCSSA96:%.*]] = phi ptr [ [[CALL33]], [[INVOKE_CONT32]] ]
22 ; CHECK-NEXT: [[LPAD_LOOPEXIT56:%.*]] = landingpad { ptr, i32 }
24 ; CHECK-NEXT: br label [[LPAD34_BODY:%.*]]
25 ; CHECK: lpad34.loopexit.split-lp:
26 ; CHECK-NEXT: [[LPAD_LOOPEXIT_SPLIT_LP57:%.*]] = landingpad { ptr, i32 }
28 ; CHECK-NEXT: br label [[LPAD34_BODY]]
30 ; CHECK-NEXT: [[TMP0:%.*]] = phi ptr [ [[DOTLCSSA101]], [[LPAD34_LOOPEXIT]] ], [ null, [[LPAD34_LOOPEXIT_SPLIT_LP:%.*]] ]
31 ; CHECK-NEXT: [[CALL3399:%.*]] = phi ptr [ [[CALL33_LCSSA96]], [[LPAD34_LOOPEXIT]] ], [ null, [[LPAD34_LOOPEXIT_SPLIT_LP]] ]
32 ; CHECK-NEXT: br label [[EHCLEANUP47]]
34 ; CHECK-NEXT: resume { ptr, i32 } zeroinitializer
37 %call33 = invoke ptr null(i64 0, ptr null)
38 to label %invoke.cont32 unwind label %lpad31.loopexit
41 invoke void null(ptr null, ptr null)
42 to label %invoke.cont37 unwind label %lpad34.loopexit
48 %lpad.loopexit = landingpad { ptr, i32 }
53 %.lcssa101 = phi ptr [ null, %invoke.cont32 ]
54 %call33.lcssa96 = phi ptr [ %call33, %invoke.cont32 ]
55 %lpad.loopexit56 = landingpad { ptr, i32 }
59 lpad34.loopexit.split-lp:
60 %lpad.loopexit.split-lp57 = landingpad { ptr, i32 }
65 %0 = phi ptr [ %.lcssa101, %lpad34.loopexit ], [ null, %lpad34.loopexit.split-lp ]
66 %call3399 = phi ptr [ %call33.lcssa96, %lpad34.loopexit ], [ null, %lpad34.loopexit.split-lp ]
70 resume { ptr, i32 } zeroinitializer
73 define i32 @test2(i64 %idx.ext.i48.pre-phi) {
74 ; CHECK-LABEL: define i32 @test2(
75 ; CHECK-SAME: i64 [[IDX_EXT_I48_PRE_PHI:%.*]]) #[[ATTR0]] {
77 ; CHECK-NEXT: br label [[DO_ACTION:%.*]]
79 ; CHECK-NEXT: switch i32 0, label [[SW_DEFAULT:%.*]] [
80 ; CHECK-NEXT: i32 1, label [[CLEANUP185:%.*]]
81 ; CHECK-NEXT: i32 2, label [[CLEANUP185]]
82 ; CHECK-NEXT: i32 0, label [[CLEANUP185]]
83 ; CHECK-NEXT: i32 4, label [[CLEANUP185]]
84 ; CHECK-NEXT: i32 5, label [[CLEANUP185]]
85 ; CHECK-NEXT: i32 6, label [[CLEANUP185]]
86 ; CHECK-NEXT: i32 7, label [[CLEANUP185]]
87 ; CHECK-NEXT: i32 8, label [[CLEANUP185]]
88 ; CHECK-NEXT: i32 9, label [[CLEANUP185]]
89 ; CHECK-NEXT: i32 10, label [[CLEANUP185]]
90 ; CHECK-NEXT: i32 11, label [[CLEANUP185]]
91 ; CHECK-NEXT: i32 12, label [[CLEANUP185]]
92 ; CHECK-NEXT: i32 13, label [[CLEANUP185]]
93 ; CHECK-NEXT: i32 14, label [[CLEANUP185]]
94 ; CHECK-NEXT: i32 15, label [[CLEANUP185]]
95 ; CHECK-NEXT: i32 16, label [[CLEANUP185]]
96 ; CHECK-NEXT: i32 17, label [[CLEANUP185]]
97 ; CHECK-NEXT: i32 18, label [[CLEANUP185]]
98 ; CHECK-NEXT: i32 19, label [[CLEANUP185]]
99 ; CHECK-NEXT: i32 20, label [[CLEANUP185]]
100 ; CHECK-NEXT: i32 21, label [[CLEANUP185]]
101 ; CHECK-NEXT: i32 22, label [[CLEANUP185]]
102 ; CHECK-NEXT: i32 23, label [[CLEANUP185]]
103 ; CHECK-NEXT: i32 24, label [[CLEANUP185]]
104 ; CHECK-NEXT: i32 25, label [[CLEANUP185]]
105 ; CHECK-NEXT: i32 26, label [[CLEANUP185]]
106 ; CHECK-NEXT: i32 27, label [[CLEANUP185]]
107 ; CHECK-NEXT: i32 28, label [[CLEANUP185]]
108 ; CHECK-NEXT: i32 29, label [[CLEANUP185]]
109 ; CHECK-NEXT: i32 30, label [[CLEANUP185]]
110 ; CHECK-NEXT: i32 31, label [[CLEANUP185]]
111 ; CHECK-NEXT: i32 32, label [[CLEANUP185]]
112 ; CHECK-NEXT: i32 33, label [[CLEANUP185]]
113 ; CHECK-NEXT: i32 34, label [[CLEANUP185]]
114 ; CHECK-NEXT: i32 35, label [[CLEANUP185]]
115 ; CHECK-NEXT: i32 36, label [[CLEANUP185]]
116 ; CHECK-NEXT: i32 37, label [[CLEANUP185]]
117 ; CHECK-NEXT: i32 38, label [[CLEANUP185]]
118 ; CHECK-NEXT: i32 39, label [[CLEANUP185]]
119 ; CHECK-NEXT: i32 40, label [[CLEANUP185]]
120 ; CHECK-NEXT: i32 41, label [[CLEANUP185]]
121 ; CHECK-NEXT: i32 42, label [[CLEANUP185]]
122 ; CHECK-NEXT: i32 43, label [[CLEANUP185]]
123 ; CHECK-NEXT: i32 44, label [[CLEANUP185]]
124 ; CHECK-NEXT: i32 45, label [[CLEANUP185]]
125 ; CHECK-NEXT: i32 46, label [[CLEANUP185]]
126 ; CHECK-NEXT: i32 47, label [[CLEANUP185]]
127 ; CHECK-NEXT: i32 48, label [[CLEANUP185]]
128 ; CHECK-NEXT: i32 49, label [[CLEANUP185]]
129 ; CHECK-NEXT: i32 50, label [[CLEANUP185]]
130 ; CHECK-NEXT: i32 51, label [[CLEANUP185]]
131 ; CHECK-NEXT: i32 52, label [[CLEANUP185]]
132 ; CHECK-NEXT: i32 53, label [[CLEANUP185]]
133 ; CHECK-NEXT: i32 54, label [[CLEANUP185]]
134 ; CHECK-NEXT: i32 55, label [[CLEANUP185]]
135 ; CHECK-NEXT: i32 56, label [[CLEANUP185]]
136 ; CHECK-NEXT: i32 57, label [[DO_ACTION]]
137 ; CHECK-NEXT: i32 58, label [[CLEANUP185]]
138 ; CHECK-NEXT: i32 59, label [[CLEANUP185]]
139 ; CHECK-NEXT: i32 60, label [[DO_ACTION]]
140 ; CHECK-NEXT: i32 61, label [[DO_ACTION]]
141 ; CHECK-NEXT: i32 62, label [[CLEANUP185]]
142 ; CHECK-NEXT: i32 70, label [[SW_BB175:%.*]]
143 ; CHECK-NEXT: i32 64, label [[CLEANUP185]]
144 ; CHECK-NEXT: i32 65, label [[DO_ACTION]]
145 ; CHECK-NEXT: i32 66, label [[DO_ACTION]]
146 ; CHECK-NEXT: i32 67, label [[CLEANUP185]]
147 ; CHECK-NEXT: i32 72, label [[CLEANUP185]]
148 ; CHECK-NEXT: i32 69, label [[DO_ACTION]]
149 ; CHECK-NEXT: i32 71, label [[CLEANUP185]]
151 ; CHECK: yy_get_previous_state.exit.loopexit:
152 ; CHECK-NEXT: br label [[YY_FIND_ACTION_BACKEDGE:%.*]]
153 ; CHECK: yy_find_action.backedge:
154 ; CHECK-NEXT: [[YY_BP_1_BE:%.*]] = phi ptr [ [[ADD_PTR_I49:%.*]], [[SW_BB175]] ], [ null, [[YY_GET_PREVIOUS_STATE_EXIT_LOOPEXIT:%.*]] ]
155 ; CHECK-NEXT: [[YY_CP_2_BE:%.*]] = phi ptr [ [[ARRAYIDX178:%.*]], [[SW_BB175]] ], [ null, [[YY_GET_PREVIOUS_STATE_EXIT_LOOPEXIT]] ]
156 ; CHECK-NEXT: br label [[DO_ACTION]]
158 ; CHECK-NEXT: [[ARRAYIDX178]] = getelementptr i8, ptr null, i64 0
159 ; CHECK-NEXT: [[ADD_PTR_I49]] = getelementptr i8, ptr null, i64 [[IDX_EXT_I48_PRE_PHI]]
160 ; CHECK-NEXT: [[CMP5_I50:%.*]] = icmp ult ptr [[ADD_PTR_I49]], [[ARRAYIDX178]]
161 ; CHECK-NEXT: br label [[YY_FIND_ACTION_BACKEDGE]]
163 ; CHECK-NEXT: unreachable
165 ; CHECK-NEXT: ret i32 0
171 switch i32 0, label %sw.default [
172 i32 1, label %cleanup185
173 i32 2, label %cleanup185
174 i32 0, label %cleanup185
175 i32 4, label %cleanup185
176 i32 5, label %cleanup185
177 i32 6, label %cleanup185
178 i32 7, label %cleanup185
179 i32 8, label %cleanup185
180 i32 9, label %cleanup185
181 i32 10, label %cleanup185
182 i32 11, label %cleanup185
183 i32 12, label %cleanup185
184 i32 13, label %cleanup185
185 i32 14, label %cleanup185
186 i32 15, label %cleanup185
187 i32 16, label %cleanup185
188 i32 17, label %cleanup185
189 i32 18, label %cleanup185
190 i32 19, label %cleanup185
191 i32 20, label %cleanup185
192 i32 21, label %cleanup185
193 i32 22, label %cleanup185
194 i32 23, label %cleanup185
195 i32 24, label %cleanup185
196 i32 25, label %cleanup185
197 i32 26, label %cleanup185
198 i32 27, label %cleanup185
199 i32 28, label %cleanup185
200 i32 29, label %cleanup185
201 i32 30, label %cleanup185
202 i32 31, label %cleanup185
203 i32 32, label %cleanup185
204 i32 33, label %cleanup185
205 i32 34, label %cleanup185
206 i32 35, label %cleanup185
207 i32 36, label %cleanup185
208 i32 37, label %cleanup185
209 i32 38, label %cleanup185
210 i32 39, label %cleanup185
211 i32 40, label %cleanup185
212 i32 41, label %cleanup185
213 i32 42, label %cleanup185
214 i32 43, label %cleanup185
215 i32 44, label %cleanup185
216 i32 45, label %cleanup185
217 i32 46, label %cleanup185
218 i32 47, label %cleanup185
219 i32 48, label %cleanup185
220 i32 49, label %cleanup185
221 i32 50, label %cleanup185
222 i32 51, label %cleanup185
223 i32 52, label %cleanup185
224 i32 53, label %cleanup185
225 i32 54, label %cleanup185
226 i32 55, label %cleanup185
227 i32 56, label %cleanup185
228 i32 57, label %do_action
229 i32 58, label %cleanup185
230 i32 59, label %cleanup185
231 i32 60, label %do_action
232 i32 61, label %do_action
233 i32 62, label %cleanup185
234 i32 70, label %sw.bb175
235 i32 64, label %cleanup185
236 i32 65, label %do_action
237 i32 66, label %do_action
238 i32 67, label %cleanup185
239 i32 72, label %cleanup185
240 i32 69, label %do_action
241 i32 71, label %cleanup185
244 yy_get_previous_state.exit.loopexit:
245 br label %yy_find_action.backedge
247 yy_find_action.backedge:
248 %yy_bp.1.be = phi ptr [ %add.ptr.i49, %sw.bb175 ], [ null, %yy_get_previous_state.exit.loopexit ]
249 %yy_cp.2.be = phi ptr [ %arrayidx178, %sw.bb175 ], [ null, %yy_get_previous_state.exit.loopexit ]
253 %arrayidx178 = getelementptr i8, ptr null, i64 0
254 %add.ptr.i49 = getelementptr i8, ptr null, i64 %idx.ext.i48.pre-phi
255 %cmp5.i50 = icmp ult ptr %add.ptr.i49, %arrayidx178
256 br label %yy_find_action.backedge