1; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2; RUN: llc -mtriple aarch64 -O0 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - 2>&1 | FileCheck %s 3 4define i32 @switch(i32 %argc) { 5 ; CHECK-LABEL: name: switch 6 ; CHECK: bb.1.entry: 7 ; CHECK: successors: %bb.3(0x40000000), %bb.6(0x40000000) 8 ; CHECK: liveins: $w0 9 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 10 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 100 11 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 200 12 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 13 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 14 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 15 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]] 16 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.3 17 ; CHECK: G_BR %bb.6 18 ; CHECK: bb.6.entry: 19 ; CHECK: successors: %bb.4(0x40000000), %bb.2(0x40000000) 20 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]] 21 ; CHECK: G_BRCOND [[ICMP1]](s1), %bb.4 22 ; CHECK: G_BR %bb.2 23 ; CHECK: bb.2.default: 24 ; CHECK: successors: %bb.5(0x80000000) 25 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C4]] 26 ; CHECK: G_BR %bb.5 27 ; CHECK: bb.3.case100: 28 ; CHECK: successors: %bb.5(0x80000000) 29 ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C3]] 30 ; CHECK: G_BR %bb.5 31 ; CHECK: bb.4.case200: 32 ; CHECK: successors: %bb.5(0x80000000) 33 ; CHECK: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]] 34 ; CHECK: bb.5.return: 35 ; CHECK: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[ADD]](s32), %bb.2, [[ADD1]](s32), %bb.3, [[ADD2]](s32), %bb.4 36 ; CHECK: $w0 = COPY [[PHI]](s32) 37 ; CHECK: RET_ReallyLR implicit $w0 38entry: 39 switch i32 %argc, label %default [ 40 i32 100, label %case100 41 i32 200, label %case200 42 ] 43 44default: 45 %tmp0 = add i32 %argc, 0 46 br label %return 47 48case100: 49 %tmp1 = add i32 %argc, 1 50 br label %return 51 52case200: 53 %tmp2 = add i32 %argc, 2 54 br label %return 55 56return: 57 %res = phi i32 [ %tmp0, %default ], [ %tmp1, %case100 ], [ %tmp2, %case200 ] 58 ret i32 %res 59} 60 61define i32 @test_cfg_remap(i32 %in) { 62 ; CHECK-LABEL: name: test_cfg_remap 63 ; CHECK: bb.1.entry: 64 ; CHECK: successors: %bb.2(0x40000000), %bb.5(0x40000000) 65 ; CHECK: liveins: $w0 66 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 67 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 68 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 57 69 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF 70 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 42 71 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]] 72 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.2 73 ; CHECK: G_BR %bb.5 74 ; CHECK: bb.5.entry: 75 ; CHECK: successors: %bb.3(0x40000000), %bb.4(0x40000000) 76 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]] 77 ; CHECK: G_BRCOND [[ICMP1]](s1), %bb.3 78 ; CHECK: G_BR %bb.4 79 ; CHECK: bb.2.next: 80 ; CHECK: successors: %bb.4(0x80000000) 81 ; CHECK: G_BR %bb.4 82 ; CHECK: bb.3.other: 83 ; CHECK: $w0 = COPY [[DEF]](s32) 84 ; CHECK: RET_ReallyLR implicit $w0 85 ; CHECK: bb.4.phi.block: 86 ; CHECK: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C]](s32), %bb.5, [[C2]](s32), %bb.2 87 ; CHECK: $w0 = COPY [[PHI]](s32) 88 ; CHECK: RET_ReallyLR implicit $w0 89entry: 90 switch i32 %in, label %phi.block [i32 1, label %next 91 i32 57, label %other] 92 93next: 94 br label %phi.block 95 96other: 97 ret i32 undef 98 99phi.block: 100 %res = phi i32 [1, %entry], [42, %next] 101 ret i32 %res 102} 103 104define i32 @test_cfg_remap_multiple_preds(i32 %in) { 105 ; CHECK-LABEL: name: test_cfg_remap_multiple_preds 106 ; CHECK: bb.1.entry: 107 ; CHECK: successors: %bb.3(0x40000000), %bb.6(0x40000000) 108 ; CHECK: liveins: $w0 109 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 110 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 111 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 57 112 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 128 113 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF 114 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 12 115 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 42 116 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]] 117 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.3 118 ; CHECK: G_BR %bb.6 119 ; CHECK: bb.6.entry: 120 ; CHECK: successors: %bb.4(0x40000000), %bb.7(0x40000000) 121 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]] 122 ; CHECK: G_BRCOND [[ICMP1]](s1), %bb.4 123 ; CHECK: G_BR %bb.7 124 ; CHECK: bb.7.entry: 125 ; CHECK: successors: %bb.5(0x40000000), %bb.8(0x40000000) 126 ; CHECK: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C2]] 127 ; CHECK: G_BRCOND [[ICMP2]](s1), %bb.5 128 ; CHECK: G_BR %bb.8 129 ; CHECK: bb.8.entry: 130 ; CHECK: successors: %bb.5(0x80000000) 131 ; CHECK: G_BR %bb.5 132 ; CHECK: bb.2.odd: 133 ; CHECK: successors: 134 ; CHECK: bb.3.next: 135 ; CHECK: successors: %bb.5(0x80000000) 136 ; CHECK: G_BR %bb.5 137 ; CHECK: bb.4.other: 138 ; CHECK: $w0 = COPY [[DEF]](s32) 139 ; CHECK: RET_ReallyLR implicit $w0 140 ; CHECK: bb.5.phi.block: 141 ; CHECK: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C]](s32), %bb.7, [[C]](s32), %bb.8, [[C4]](s32), %bb.3 142 ; CHECK: $w0 = COPY [[C3]](s32) 143 ; CHECK: RET_ReallyLR implicit $w0 144entry: 145 switch i32 %in, label %odd [i32 1, label %next 146 i32 57, label %other 147 i32 128, label %phi.block 148 i32 256, label %phi.block] 149odd: 150 unreachable 151 152next: 153 br label %phi.block 154 155other: 156 ret i32 undef 157 158phi.block: 159 %res = phi i32 [1, %entry], [1, %entry], [42, %next] 160 ret i32 12 161} 162 163define i32 @jt_test(i32 %x) { 164 ; CHECK-LABEL: name: jt_test 165 ; CHECK: bb.1.entry: 166 ; CHECK: successors: %bb.4(0x40000000), %bb.5(0x40000000) 167 ; CHECK: liveins: $w0 168 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 169 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 71 170 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 171 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 42 172 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 173 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 174 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[C4]] 175 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[SUB]](s32) 176 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[C]](s32) 177 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[ZEXT]](s64), [[ZEXT1]] 178 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.4 179 ; CHECK: bb.5.entry: 180 ; CHECK: successors: %bb.3(0x2aaaaaab), %bb.4(0x2aaaaaab), %bb.2(0x2aaaaaab) 181 ; CHECK: [[JUMP_TABLE:%[0-9]+]]:_(p0) = G_JUMP_TABLE %jump-table.0 182 ; CHECK: G_BRJT [[JUMP_TABLE]](p0), %jump-table.0, [[ZEXT]](s64) 183 ; CHECK: bb.2.sw.bb: 184 ; CHECK: successors: %bb.4(0x80000000) 185 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = nsw G_ADD [[COPY]], [[C2]] 186 ; CHECK: G_BR %bb.4 187 ; CHECK: bb.3.sw.bb1: 188 ; CHECK: successors: %bb.4(0x80000000) 189 ; CHECK: [[MUL:%[0-9]+]]:_(s32) = nsw G_MUL [[COPY]], [[C1]] 190 ; CHECK: bb.4.return: 191 ; CHECK: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[MUL]](s32), %bb.3, [[ADD]](s32), %bb.2, [[C3]](s32), %bb.1, [[C3]](s32), %bb.5 192 ; CHECK: $w0 = COPY [[PHI]](s32) 193 ; CHECK: RET_ReallyLR implicit $w0 194entry: 195 switch i32 %x, label %return [ 196 i32 75, label %sw.bb 197 i32 34, label %sw.bb 198 i32 56, label %sw.bb 199 i32 35, label %sw.bb 200 i32 40, label %sw.bb 201 i32 4, label %sw.bb1 202 i32 5, label %sw.bb1 203 i32 6, label %sw.bb1 204 ] 205 206sw.bb: 207 %add = add nsw i32 %x, 42 208 br label %return 209 210sw.bb1: 211 %mul = mul nsw i32 %x, 3 212 br label %return 213 214return: 215 %retval.0 = phi i32 [ %mul, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ] 216 ret i32 %retval.0 217} 218 219%0 = type { i32, i32* } 220%1 = type { i32*, i32, i32 } 221 222@global = external hidden constant [55 x %0], align 8 223 224define void @jt_multiple_jump_tables(%1* %arg, i32 %arg1, i32* %arg2) { 225 ; CHECK-LABEL: name: jt_multiple_jump_tables 226 ; CHECK: bb.1.bb: 227 ; CHECK: successors: %bb.56(0x40000000), %bb.61(0x40000000) 228 ; CHECK: liveins: $w1, $x0, $x2 229 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 230 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1 231 ; CHECK: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2 232 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 233 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 234 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 235 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 236 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 237 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 238 ; CHECK: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 10 239 ; CHECK: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 11 240 ; CHECK: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 12 241 ; CHECK: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 13 242 ; CHECK: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 14 243 ; CHECK: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 15 244 ; CHECK: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 16 245 ; CHECK: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 17 246 ; CHECK: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 18 247 ; CHECK: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 19 248 ; CHECK: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 20 249 ; CHECK: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 21 250 ; CHECK: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 22 251 ; CHECK: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 23 252 ; CHECK: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 24 253 ; CHECK: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 25 254 ; CHECK: [[C22:%[0-9]+]]:_(s32) = G_CONSTANT i32 26 255 ; CHECK: [[C23:%[0-9]+]]:_(s32) = G_CONSTANT i32 27 256 ; CHECK: [[C24:%[0-9]+]]:_(s32) = G_CONSTANT i32 28 257 ; CHECK: [[C25:%[0-9]+]]:_(s32) = G_CONSTANT i32 29 258 ; CHECK: [[C26:%[0-9]+]]:_(s32) = G_CONSTANT i32 30 259 ; CHECK: [[C27:%[0-9]+]]:_(s32) = G_CONSTANT i32 31 260 ; CHECK: [[C28:%[0-9]+]]:_(s32) = G_CONSTANT i32 32 261 ; CHECK: [[C29:%[0-9]+]]:_(s32) = G_CONSTANT i32 33 262 ; CHECK: [[C30:%[0-9]+]]:_(s32) = G_CONSTANT i32 34 263 ; CHECK: [[C31:%[0-9]+]]:_(s32) = G_CONSTANT i32 35 264 ; CHECK: [[C32:%[0-9]+]]:_(s32) = G_CONSTANT i32 36 265 ; CHECK: [[C33:%[0-9]+]]:_(s32) = G_CONSTANT i32 37 266 ; CHECK: [[C34:%[0-9]+]]:_(s32) = G_CONSTANT i32 38 267 ; CHECK: [[C35:%[0-9]+]]:_(s32) = G_CONSTANT i32 39 268 ; CHECK: [[C36:%[0-9]+]]:_(s32) = G_CONSTANT i32 41 269 ; CHECK: [[C37:%[0-9]+]]:_(s32) = G_CONSTANT i32 42 270 ; CHECK: [[C38:%[0-9]+]]:_(s32) = G_CONSTANT i32 43 271 ; CHECK: [[C39:%[0-9]+]]:_(s32) = G_CONSTANT i32 44 272 ; CHECK: [[C40:%[0-9]+]]:_(s32) = G_CONSTANT i32 45 273 ; CHECK: [[C41:%[0-9]+]]:_(s32) = G_CONSTANT i32 46 274 ; CHECK: [[C42:%[0-9]+]]:_(s32) = G_CONSTANT i32 47 275 ; CHECK: [[C43:%[0-9]+]]:_(s32) = G_CONSTANT i32 48 276 ; CHECK: [[C44:%[0-9]+]]:_(s32) = G_CONSTANT i32 49 277 ; CHECK: [[C45:%[0-9]+]]:_(s32) = G_CONSTANT i32 50 278 ; CHECK: [[C46:%[0-9]+]]:_(s32) = G_CONSTANT i32 51 279 ; CHECK: [[C47:%[0-9]+]]:_(s32) = G_CONSTANT i32 52 280 ; CHECK: [[C48:%[0-9]+]]:_(s32) = G_CONSTANT i32 53 281 ; CHECK: [[C49:%[0-9]+]]:_(s32) = G_CONSTANT i32 54 282 ; CHECK: [[C50:%[0-9]+]]:_(s32) = G_CONSTANT i32 55 283 ; CHECK: [[C51:%[0-9]+]]:_(s32) = G_CONSTANT i32 4352 284 ; CHECK: [[C52:%[0-9]+]]:_(s32) = G_CONSTANT i32 4353 285 ; CHECK: [[C53:%[0-9]+]]:_(s32) = G_CONSTANT i32 4354 286 ; CHECK: [[C54:%[0-9]+]]:_(s32) = G_CONSTANT i32 4355 287 ; CHECK: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @global 288 ; CHECK: [[C55:%[0-9]+]]:_(p0) = G_CONSTANT i64 0 289 ; CHECK: [[C56:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 290 ; CHECK: [[C57:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 291 ; CHECK: [[C58:%[0-9]+]]:_(s64) = G_CONSTANT i64 2 292 ; CHECK: [[C59:%[0-9]+]]:_(s64) = G_CONSTANT i64 3 293 ; CHECK: [[C60:%[0-9]+]]:_(s64) = G_CONSTANT i64 4 294 ; CHECK: [[C61:%[0-9]+]]:_(s64) = G_CONSTANT i64 5 295 ; CHECK: [[C62:%[0-9]+]]:_(s64) = G_CONSTANT i64 6 296 ; CHECK: [[C63:%[0-9]+]]:_(s64) = G_CONSTANT i64 7 297 ; CHECK: [[C64:%[0-9]+]]:_(s64) = G_CONSTANT i64 8 298 ; CHECK: [[C65:%[0-9]+]]:_(s64) = G_CONSTANT i64 9 299 ; CHECK: [[C66:%[0-9]+]]:_(s64) = G_CONSTANT i64 10 300 ; CHECK: [[C67:%[0-9]+]]:_(s64) = G_CONSTANT i64 11 301 ; CHECK: [[C68:%[0-9]+]]:_(s64) = G_CONSTANT i64 12 302 ; CHECK: [[C69:%[0-9]+]]:_(s64) = G_CONSTANT i64 13 303 ; CHECK: [[C70:%[0-9]+]]:_(s64) = G_CONSTANT i64 14 304 ; CHECK: [[C71:%[0-9]+]]:_(s64) = G_CONSTANT i64 15 305 ; CHECK: [[C72:%[0-9]+]]:_(s64) = G_CONSTANT i64 16 306 ; CHECK: [[C73:%[0-9]+]]:_(s64) = G_CONSTANT i64 17 307 ; CHECK: [[C74:%[0-9]+]]:_(s64) = G_CONSTANT i64 18 308 ; CHECK: [[C75:%[0-9]+]]:_(s64) = G_CONSTANT i64 19 309 ; CHECK: [[C76:%[0-9]+]]:_(s64) = G_CONSTANT i64 20 310 ; CHECK: [[C77:%[0-9]+]]:_(s64) = G_CONSTANT i64 21 311 ; CHECK: [[C78:%[0-9]+]]:_(s64) = G_CONSTANT i64 22 312 ; CHECK: [[C79:%[0-9]+]]:_(s64) = G_CONSTANT i64 23 313 ; CHECK: [[C80:%[0-9]+]]:_(s64) = G_CONSTANT i64 24 314 ; CHECK: [[C81:%[0-9]+]]:_(s64) = G_CONSTANT i64 25 315 ; CHECK: [[C82:%[0-9]+]]:_(s64) = G_CONSTANT i64 26 316 ; CHECK: [[C83:%[0-9]+]]:_(s64) = G_CONSTANT i64 27 317 ; CHECK: [[C84:%[0-9]+]]:_(s64) = G_CONSTANT i64 28 318 ; CHECK: [[C85:%[0-9]+]]:_(s64) = G_CONSTANT i64 29 319 ; CHECK: [[C86:%[0-9]+]]:_(s64) = G_CONSTANT i64 30 320 ; CHECK: [[C87:%[0-9]+]]:_(s64) = G_CONSTANT i64 31 321 ; CHECK: [[C88:%[0-9]+]]:_(s64) = G_CONSTANT i64 32 322 ; CHECK: [[C89:%[0-9]+]]:_(s64) = G_CONSTANT i64 33 323 ; CHECK: [[C90:%[0-9]+]]:_(s64) = G_CONSTANT i64 34 324 ; CHECK: [[C91:%[0-9]+]]:_(s64) = G_CONSTANT i64 35 325 ; CHECK: [[C92:%[0-9]+]]:_(s64) = G_CONSTANT i64 36 326 ; CHECK: [[C93:%[0-9]+]]:_(s64) = G_CONSTANT i64 37 327 ; CHECK: [[C94:%[0-9]+]]:_(s64) = G_CONSTANT i64 38 328 ; CHECK: [[C95:%[0-9]+]]:_(s64) = G_CONSTANT i64 39 329 ; CHECK: [[C96:%[0-9]+]]:_(s64) = G_CONSTANT i64 40 330 ; CHECK: [[C97:%[0-9]+]]:_(s64) = G_CONSTANT i64 41 331 ; CHECK: [[C98:%[0-9]+]]:_(s64) = G_CONSTANT i64 42 332 ; CHECK: [[C99:%[0-9]+]]:_(s64) = G_CONSTANT i64 43 333 ; CHECK: [[C100:%[0-9]+]]:_(s64) = G_CONSTANT i64 44 334 ; CHECK: [[C101:%[0-9]+]]:_(s64) = G_CONSTANT i64 45 335 ; CHECK: [[C102:%[0-9]+]]:_(s64) = G_CONSTANT i64 46 336 ; CHECK: [[C103:%[0-9]+]]:_(s64) = G_CONSTANT i64 47 337 ; CHECK: [[C104:%[0-9]+]]:_(s64) = G_CONSTANT i64 48 338 ; CHECK: [[C105:%[0-9]+]]:_(s64) = G_CONSTANT i64 49 339 ; CHECK: [[C106:%[0-9]+]]:_(s64) = G_CONSTANT i64 50 340 ; CHECK: [[C107:%[0-9]+]]:_(s64) = G_CONSTANT i64 51 341 ; CHECK: [[C108:%[0-9]+]]:_(s64) = G_CONSTANT i64 52 342 ; CHECK: [[C109:%[0-9]+]]:_(s64) = G_CONSTANT i64 53 343 ; CHECK: [[C110:%[0-9]+]]:_(s64) = G_CONSTANT i64 54 344 ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0.tmp 345 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]] 346 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.56 347 ; CHECK: G_BR %bb.61 348 ; CHECK: bb.61.bb: 349 ; CHECK: successors: %bb.2(0x40000000), %bb.62(0x40000000) 350 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C1]] 351 ; CHECK: G_BRCOND [[ICMP1]](s1), %bb.2 352 ; CHECK: G_BR %bb.62 353 ; CHECK: bb.62.bb: 354 ; CHECK: successors: %bb.3(0x40000000), %bb.63(0x40000000) 355 ; CHECK: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C2]] 356 ; CHECK: G_BRCOND [[ICMP2]](s1), %bb.3 357 ; CHECK: G_BR %bb.63 358 ; CHECK: bb.63.bb: 359 ; CHECK: successors: %bb.4(0x40000000), %bb.64(0x40000000) 360 ; CHECK: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C3]] 361 ; CHECK: G_BRCOND [[ICMP3]](s1), %bb.4 362 ; CHECK: G_BR %bb.64 363 ; CHECK: bb.64.bb: 364 ; CHECK: successors: %bb.5(0x40000000), %bb.65(0x40000000) 365 ; CHECK: [[ICMP4:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C4]] 366 ; CHECK: G_BRCOND [[ICMP4]](s1), %bb.5 367 ; CHECK: G_BR %bb.65 368 ; CHECK: bb.65.bb: 369 ; CHECK: successors: %bb.6(0x40000000), %bb.66(0x40000000) 370 ; CHECK: [[ICMP5:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C5]] 371 ; CHECK: G_BRCOND [[ICMP5]](s1), %bb.6 372 ; CHECK: G_BR %bb.66 373 ; CHECK: bb.66.bb: 374 ; CHECK: successors: %bb.7(0x40000000), %bb.67(0x40000000) 375 ; CHECK: [[ICMP6:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C6]] 376 ; CHECK: G_BRCOND [[ICMP6]](s1), %bb.7 377 ; CHECK: G_BR %bb.67 378 ; CHECK: bb.67.bb: 379 ; CHECK: successors: %bb.8(0x40000000), %bb.68(0x40000000) 380 ; CHECK: [[ICMP7:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C7]] 381 ; CHECK: G_BRCOND [[ICMP7]](s1), %bb.8 382 ; CHECK: G_BR %bb.68 383 ; CHECK: bb.68.bb: 384 ; CHECK: successors: %bb.9(0x40000000), %bb.69(0x40000000) 385 ; CHECK: [[ICMP8:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C8]] 386 ; CHECK: G_BRCOND [[ICMP8]](s1), %bb.9 387 ; CHECK: G_BR %bb.69 388 ; CHECK: bb.69.bb: 389 ; CHECK: successors: %bb.10(0x40000000), %bb.70(0x40000000) 390 ; CHECK: [[ICMP9:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C9]] 391 ; CHECK: G_BRCOND [[ICMP9]](s1), %bb.10 392 ; CHECK: G_BR %bb.70 393 ; CHECK: bb.70.bb: 394 ; CHECK: successors: %bb.11(0x40000000), %bb.71(0x40000000) 395 ; CHECK: [[ICMP10:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C10]] 396 ; CHECK: G_BRCOND [[ICMP10]](s1), %bb.11 397 ; CHECK: G_BR %bb.71 398 ; CHECK: bb.71.bb: 399 ; CHECK: successors: %bb.12(0x40000000), %bb.72(0x40000000) 400 ; CHECK: [[ICMP11:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C11]] 401 ; CHECK: G_BRCOND [[ICMP11]](s1), %bb.12 402 ; CHECK: G_BR %bb.72 403 ; CHECK: bb.72.bb: 404 ; CHECK: successors: %bb.13(0x40000000), %bb.73(0x40000000) 405 ; CHECK: [[ICMP12:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C12]] 406 ; CHECK: G_BRCOND [[ICMP12]](s1), %bb.13 407 ; CHECK: G_BR %bb.73 408 ; CHECK: bb.73.bb: 409 ; CHECK: successors: %bb.14(0x40000000), %bb.74(0x40000000) 410 ; CHECK: [[ICMP13:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C13]] 411 ; CHECK: G_BRCOND [[ICMP13]](s1), %bb.14 412 ; CHECK: G_BR %bb.74 413 ; CHECK: bb.74.bb: 414 ; CHECK: successors: %bb.15(0x40000000), %bb.75(0x40000000) 415 ; CHECK: [[ICMP14:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C14]] 416 ; CHECK: G_BRCOND [[ICMP14]](s1), %bb.15 417 ; CHECK: G_BR %bb.75 418 ; CHECK: bb.75.bb: 419 ; CHECK: successors: %bb.16(0x40000000), %bb.76(0x40000000) 420 ; CHECK: [[ICMP15:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C15]] 421 ; CHECK: G_BRCOND [[ICMP15]](s1), %bb.16 422 ; CHECK: G_BR %bb.76 423 ; CHECK: bb.76.bb: 424 ; CHECK: successors: %bb.17(0x40000000), %bb.77(0x40000000) 425 ; CHECK: [[ICMP16:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C16]] 426 ; CHECK: G_BRCOND [[ICMP16]](s1), %bb.17 427 ; CHECK: G_BR %bb.77 428 ; CHECK: bb.77.bb: 429 ; CHECK: successors: %bb.18(0x40000000), %bb.78(0x40000000) 430 ; CHECK: [[ICMP17:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C17]] 431 ; CHECK: G_BRCOND [[ICMP17]](s1), %bb.18 432 ; CHECK: G_BR %bb.78 433 ; CHECK: bb.78.bb: 434 ; CHECK: successors: %bb.19(0x40000000), %bb.79(0x40000000) 435 ; CHECK: [[ICMP18:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C18]] 436 ; CHECK: G_BRCOND [[ICMP18]](s1), %bb.19 437 ; CHECK: G_BR %bb.79 438 ; CHECK: bb.79.bb: 439 ; CHECK: successors: %bb.20(0x40000000), %bb.80(0x40000000) 440 ; CHECK: [[ICMP19:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C19]] 441 ; CHECK: G_BRCOND [[ICMP19]](s1), %bb.20 442 ; CHECK: G_BR %bb.80 443 ; CHECK: bb.80.bb: 444 ; CHECK: successors: %bb.21(0x40000000), %bb.81(0x40000000) 445 ; CHECK: [[ICMP20:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C20]] 446 ; CHECK: G_BRCOND [[ICMP20]](s1), %bb.21 447 ; CHECK: G_BR %bb.81 448 ; CHECK: bb.81.bb: 449 ; CHECK: successors: %bb.22(0x40000000), %bb.82(0x40000000) 450 ; CHECK: [[ICMP21:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C21]] 451 ; CHECK: G_BRCOND [[ICMP21]](s1), %bb.22 452 ; CHECK: G_BR %bb.82 453 ; CHECK: bb.82.bb: 454 ; CHECK: successors: %bb.23(0x40000000), %bb.83(0x40000000) 455 ; CHECK: [[ICMP22:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C22]] 456 ; CHECK: G_BRCOND [[ICMP22]](s1), %bb.23 457 ; CHECK: G_BR %bb.83 458 ; CHECK: bb.83.bb: 459 ; CHECK: successors: %bb.24(0x40000000), %bb.84(0x40000000) 460 ; CHECK: [[ICMP23:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C23]] 461 ; CHECK: G_BRCOND [[ICMP23]](s1), %bb.24 462 ; CHECK: G_BR %bb.84 463 ; CHECK: bb.84.bb: 464 ; CHECK: successors: %bb.25(0x40000000), %bb.85(0x40000000) 465 ; CHECK: [[ICMP24:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C24]] 466 ; CHECK: G_BRCOND [[ICMP24]](s1), %bb.25 467 ; CHECK: G_BR %bb.85 468 ; CHECK: bb.85.bb: 469 ; CHECK: successors: %bb.26(0x40000000), %bb.86(0x40000000) 470 ; CHECK: [[ICMP25:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C25]] 471 ; CHECK: G_BRCOND [[ICMP25]](s1), %bb.26 472 ; CHECK: G_BR %bb.86 473 ; CHECK: bb.86.bb: 474 ; CHECK: successors: %bb.27(0x40000000), %bb.87(0x40000000) 475 ; CHECK: [[ICMP26:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C26]] 476 ; CHECK: G_BRCOND [[ICMP26]](s1), %bb.27 477 ; CHECK: G_BR %bb.87 478 ; CHECK: bb.87.bb: 479 ; CHECK: successors: %bb.28(0x40000000), %bb.88(0x40000000) 480 ; CHECK: [[ICMP27:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C27]] 481 ; CHECK: G_BRCOND [[ICMP27]](s1), %bb.28 482 ; CHECK: G_BR %bb.88 483 ; CHECK: bb.88.bb: 484 ; CHECK: successors: %bb.29(0x40000000), %bb.89(0x40000000) 485 ; CHECK: [[ICMP28:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C28]] 486 ; CHECK: G_BRCOND [[ICMP28]](s1), %bb.29 487 ; CHECK: G_BR %bb.89 488 ; CHECK: bb.89.bb: 489 ; CHECK: successors: %bb.30(0x40000000), %bb.90(0x40000000) 490 ; CHECK: [[ICMP29:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C29]] 491 ; CHECK: G_BRCOND [[ICMP29]](s1), %bb.30 492 ; CHECK: G_BR %bb.90 493 ; CHECK: bb.90.bb: 494 ; CHECK: successors: %bb.31(0x40000000), %bb.91(0x40000000) 495 ; CHECK: [[ICMP30:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C30]] 496 ; CHECK: G_BRCOND [[ICMP30]](s1), %bb.31 497 ; CHECK: G_BR %bb.91 498 ; CHECK: bb.91.bb: 499 ; CHECK: successors: %bb.32(0x40000000), %bb.92(0x40000000) 500 ; CHECK: [[ICMP31:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C31]] 501 ; CHECK: G_BRCOND [[ICMP31]](s1), %bb.32 502 ; CHECK: G_BR %bb.92 503 ; CHECK: bb.92.bb: 504 ; CHECK: successors: %bb.33(0x40000000), %bb.93(0x40000000) 505 ; CHECK: [[ICMP32:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C32]] 506 ; CHECK: G_BRCOND [[ICMP32]](s1), %bb.33 507 ; CHECK: G_BR %bb.93 508 ; CHECK: bb.93.bb: 509 ; CHECK: successors: %bb.34(0x40000000), %bb.94(0x40000000) 510 ; CHECK: [[ICMP33:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C33]] 511 ; CHECK: G_BRCOND [[ICMP33]](s1), %bb.34 512 ; CHECK: G_BR %bb.94 513 ; CHECK: bb.94.bb: 514 ; CHECK: successors: %bb.35(0x40000000), %bb.95(0x40000000) 515 ; CHECK: [[ICMP34:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C34]] 516 ; CHECK: G_BRCOND [[ICMP34]](s1), %bb.35 517 ; CHECK: G_BR %bb.95 518 ; CHECK: bb.95.bb: 519 ; CHECK: successors: %bb.36(0x40000000), %bb.96(0x40000000) 520 ; CHECK: [[ICMP35:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C35]] 521 ; CHECK: G_BRCOND [[ICMP35]](s1), %bb.36 522 ; CHECK: G_BR %bb.96 523 ; CHECK: bb.96.bb: 524 ; CHECK: successors: %bb.37(0x40000000), %bb.97(0x40000000) 525 ; CHECK: [[ICMP36:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C36]] 526 ; CHECK: G_BRCOND [[ICMP36]](s1), %bb.37 527 ; CHECK: G_BR %bb.97 528 ; CHECK: bb.97.bb: 529 ; CHECK: successors: %bb.38(0x40000000), %bb.98(0x40000000) 530 ; CHECK: [[ICMP37:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C37]] 531 ; CHECK: G_BRCOND [[ICMP37]](s1), %bb.38 532 ; CHECK: G_BR %bb.98 533 ; CHECK: bb.98.bb: 534 ; CHECK: successors: %bb.39(0x40000000), %bb.99(0x40000000) 535 ; CHECK: [[ICMP38:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C38]] 536 ; CHECK: G_BRCOND [[ICMP38]](s1), %bb.39 537 ; CHECK: G_BR %bb.99 538 ; CHECK: bb.99.bb: 539 ; CHECK: successors: %bb.40(0x40000000), %bb.100(0x40000000) 540 ; CHECK: [[ICMP39:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C39]] 541 ; CHECK: G_BRCOND [[ICMP39]](s1), %bb.40 542 ; CHECK: G_BR %bb.100 543 ; CHECK: bb.100.bb: 544 ; CHECK: successors: %bb.41(0x40000000), %bb.101(0x40000000) 545 ; CHECK: [[ICMP40:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C40]] 546 ; CHECK: G_BRCOND [[ICMP40]](s1), %bb.41 547 ; CHECK: G_BR %bb.101 548 ; CHECK: bb.101.bb: 549 ; CHECK: successors: %bb.42(0x40000000), %bb.102(0x40000000) 550 ; CHECK: [[ICMP41:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C41]] 551 ; CHECK: G_BRCOND [[ICMP41]](s1), %bb.42 552 ; CHECK: G_BR %bb.102 553 ; CHECK: bb.102.bb: 554 ; CHECK: successors: %bb.43(0x40000000), %bb.103(0x40000000) 555 ; CHECK: [[ICMP42:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C42]] 556 ; CHECK: G_BRCOND [[ICMP42]](s1), %bb.43 557 ; CHECK: G_BR %bb.103 558 ; CHECK: bb.103.bb: 559 ; CHECK: successors: %bb.44(0x40000000), %bb.104(0x40000000) 560 ; CHECK: [[ICMP43:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C43]] 561 ; CHECK: G_BRCOND [[ICMP43]](s1), %bb.44 562 ; CHECK: G_BR %bb.104 563 ; CHECK: bb.104.bb: 564 ; CHECK: successors: %bb.45(0x40000000), %bb.105(0x40000000) 565 ; CHECK: [[ICMP44:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C44]] 566 ; CHECK: G_BRCOND [[ICMP44]](s1), %bb.45 567 ; CHECK: G_BR %bb.105 568 ; CHECK: bb.105.bb: 569 ; CHECK: successors: %bb.46(0x40000000), %bb.106(0x40000000) 570 ; CHECK: [[ICMP45:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C45]] 571 ; CHECK: G_BRCOND [[ICMP45]](s1), %bb.46 572 ; CHECK: G_BR %bb.106 573 ; CHECK: bb.106.bb: 574 ; CHECK: successors: %bb.47(0x40000000), %bb.107(0x40000000) 575 ; CHECK: [[ICMP46:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C46]] 576 ; CHECK: G_BRCOND [[ICMP46]](s1), %bb.47 577 ; CHECK: G_BR %bb.107 578 ; CHECK: bb.107.bb: 579 ; CHECK: successors: %bb.48(0x40000000), %bb.108(0x40000000) 580 ; CHECK: [[ICMP47:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C47]] 581 ; CHECK: G_BRCOND [[ICMP47]](s1), %bb.48 582 ; CHECK: G_BR %bb.108 583 ; CHECK: bb.108.bb: 584 ; CHECK: successors: %bb.49(0x40000000), %bb.109(0x40000000) 585 ; CHECK: [[ICMP48:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C48]] 586 ; CHECK: G_BRCOND [[ICMP48]](s1), %bb.49 587 ; CHECK: G_BR %bb.109 588 ; CHECK: bb.109.bb: 589 ; CHECK: successors: %bb.50(0x40000000), %bb.110(0x40000000) 590 ; CHECK: [[ICMP49:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C49]] 591 ; CHECK: G_BRCOND [[ICMP49]](s1), %bb.50 592 ; CHECK: G_BR %bb.110 593 ; CHECK: bb.110.bb: 594 ; CHECK: successors: %bb.51(0x40000000), %bb.111(0x40000000) 595 ; CHECK: [[ICMP50:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C50]] 596 ; CHECK: G_BRCOND [[ICMP50]](s1), %bb.51 597 ; CHECK: G_BR %bb.111 598 ; CHECK: bb.111.bb: 599 ; CHECK: successors: %bb.52(0x40000000), %bb.112(0x40000000) 600 ; CHECK: [[ICMP51:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C51]] 601 ; CHECK: G_BRCOND [[ICMP51]](s1), %bb.52 602 ; CHECK: G_BR %bb.112 603 ; CHECK: bb.112.bb: 604 ; CHECK: successors: %bb.53(0x40000000), %bb.113(0x40000000) 605 ; CHECK: [[ICMP52:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C52]] 606 ; CHECK: G_BRCOND [[ICMP52]](s1), %bb.53 607 ; CHECK: G_BR %bb.113 608 ; CHECK: bb.113.bb: 609 ; CHECK: successors: %bb.54(0x40000000), %bb.114(0x40000000) 610 ; CHECK: [[ICMP53:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C53]] 611 ; CHECK: G_BRCOND [[ICMP53]](s1), %bb.54 612 ; CHECK: G_BR %bb.114 613 ; CHECK: bb.114.bb: 614 ; CHECK: successors: %bb.55(0x40000000), %bb.60(0x40000000) 615 ; CHECK: [[ICMP54:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C54]] 616 ; CHECK: G_BRCOND [[ICMP54]](s1), %bb.55 617 ; CHECK: G_BR %bb.60 618 ; CHECK: bb.2.bb3: 619 ; CHECK: successors: %bb.56(0x80000000) 620 ; CHECK: G_BR %bb.56 621 ; CHECK: bb.3.bb4: 622 ; CHECK: successors: %bb.56(0x80000000) 623 ; CHECK: G_BR %bb.56 624 ; CHECK: bb.4.bb5: 625 ; CHECK: successors: %bb.56(0x80000000) 626 ; CHECK: G_BR %bb.56 627 ; CHECK: bb.5.bb6: 628 ; CHECK: successors: %bb.56(0x80000000) 629 ; CHECK: G_BR %bb.56 630 ; CHECK: bb.6.bb7: 631 ; CHECK: successors: %bb.56(0x80000000) 632 ; CHECK: G_BR %bb.56 633 ; CHECK: bb.7.bb8: 634 ; CHECK: successors: %bb.56(0x80000000) 635 ; CHECK: G_BR %bb.56 636 ; CHECK: bb.8.bb9: 637 ; CHECK: successors: %bb.56(0x80000000) 638 ; CHECK: G_BR %bb.56 639 ; CHECK: bb.9.bb10: 640 ; CHECK: successors: %bb.56(0x80000000) 641 ; CHECK: G_BR %bb.56 642 ; CHECK: bb.10.bb11: 643 ; CHECK: successors: %bb.56(0x80000000) 644 ; CHECK: G_BR %bb.56 645 ; CHECK: bb.11.bb12: 646 ; CHECK: successors: %bb.56(0x80000000) 647 ; CHECK: G_BR %bb.56 648 ; CHECK: bb.12.bb13: 649 ; CHECK: successors: %bb.56(0x80000000) 650 ; CHECK: G_BR %bb.56 651 ; CHECK: bb.13.bb14: 652 ; CHECK: successors: %bb.56(0x80000000) 653 ; CHECK: G_BR %bb.56 654 ; CHECK: bb.14.bb15: 655 ; CHECK: successors: %bb.56(0x80000000) 656 ; CHECK: G_BR %bb.56 657 ; CHECK: bb.15.bb16: 658 ; CHECK: successors: %bb.56(0x80000000) 659 ; CHECK: G_BR %bb.56 660 ; CHECK: bb.16.bb17: 661 ; CHECK: successors: %bb.56(0x80000000) 662 ; CHECK: G_BR %bb.56 663 ; CHECK: bb.17.bb18: 664 ; CHECK: successors: %bb.56(0x80000000) 665 ; CHECK: G_BR %bb.56 666 ; CHECK: bb.18.bb19: 667 ; CHECK: successors: %bb.56(0x80000000) 668 ; CHECK: G_BR %bb.56 669 ; CHECK: bb.19.bb20: 670 ; CHECK: successors: %bb.56(0x80000000) 671 ; CHECK: G_BR %bb.56 672 ; CHECK: bb.20.bb21: 673 ; CHECK: successors: %bb.56(0x80000000) 674 ; CHECK: G_BR %bb.56 675 ; CHECK: bb.21.bb22: 676 ; CHECK: successors: %bb.56(0x80000000) 677 ; CHECK: G_BR %bb.56 678 ; CHECK: bb.22.bb23: 679 ; CHECK: successors: %bb.56(0x80000000) 680 ; CHECK: G_BR %bb.56 681 ; CHECK: bb.23.bb24: 682 ; CHECK: successors: %bb.56(0x80000000) 683 ; CHECK: G_BR %bb.56 684 ; CHECK: bb.24.bb25: 685 ; CHECK: successors: %bb.56(0x80000000) 686 ; CHECK: G_BR %bb.56 687 ; CHECK: bb.25.bb26: 688 ; CHECK: successors: %bb.56(0x80000000) 689 ; CHECK: G_BR %bb.56 690 ; CHECK: bb.26.bb27: 691 ; CHECK: successors: %bb.56(0x80000000) 692 ; CHECK: G_BR %bb.56 693 ; CHECK: bb.27.bb28: 694 ; CHECK: successors: %bb.56(0x80000000) 695 ; CHECK: G_BR %bb.56 696 ; CHECK: bb.28.bb29: 697 ; CHECK: successors: %bb.56(0x80000000) 698 ; CHECK: G_BR %bb.56 699 ; CHECK: bb.29.bb30: 700 ; CHECK: successors: %bb.56(0x80000000) 701 ; CHECK: G_BR %bb.56 702 ; CHECK: bb.30.bb31: 703 ; CHECK: successors: %bb.56(0x80000000) 704 ; CHECK: G_BR %bb.56 705 ; CHECK: bb.31.bb32: 706 ; CHECK: successors: %bb.56(0x80000000) 707 ; CHECK: G_BR %bb.56 708 ; CHECK: bb.32.bb33: 709 ; CHECK: successors: %bb.56(0x80000000) 710 ; CHECK: G_BR %bb.56 711 ; CHECK: bb.33.bb34: 712 ; CHECK: successors: %bb.56(0x80000000) 713 ; CHECK: G_BR %bb.56 714 ; CHECK: bb.34.bb35: 715 ; CHECK: successors: %bb.56(0x80000000) 716 ; CHECK: G_BR %bb.56 717 ; CHECK: bb.35.bb36: 718 ; CHECK: successors: %bb.56(0x80000000) 719 ; CHECK: G_BR %bb.56 720 ; CHECK: bb.36.bb37: 721 ; CHECK: successors: %bb.56(0x80000000) 722 ; CHECK: G_BR %bb.56 723 ; CHECK: bb.37.bb38: 724 ; CHECK: successors: %bb.56(0x80000000) 725 ; CHECK: G_BR %bb.56 726 ; CHECK: bb.38.bb39: 727 ; CHECK: successors: %bb.56(0x80000000) 728 ; CHECK: G_BR %bb.56 729 ; CHECK: bb.39.bb40: 730 ; CHECK: successors: %bb.56(0x80000000) 731 ; CHECK: G_BR %bb.56 732 ; CHECK: bb.40.bb41: 733 ; CHECK: successors: %bb.56(0x80000000) 734 ; CHECK: G_BR %bb.56 735 ; CHECK: bb.41.bb42: 736 ; CHECK: successors: %bb.56(0x80000000) 737 ; CHECK: G_BR %bb.56 738 ; CHECK: bb.42.bb43: 739 ; CHECK: successors: %bb.56(0x80000000) 740 ; CHECK: G_BR %bb.56 741 ; CHECK: bb.43.bb44: 742 ; CHECK: successors: %bb.56(0x80000000) 743 ; CHECK: G_BR %bb.56 744 ; CHECK: bb.44.bb45: 745 ; CHECK: successors: %bb.56(0x80000000) 746 ; CHECK: G_BR %bb.56 747 ; CHECK: bb.45.bb46: 748 ; CHECK: successors: %bb.56(0x80000000) 749 ; CHECK: G_BR %bb.56 750 ; CHECK: bb.46.bb47: 751 ; CHECK: successors: %bb.56(0x80000000) 752 ; CHECK: G_BR %bb.56 753 ; CHECK: bb.47.bb48: 754 ; CHECK: successors: %bb.56(0x80000000) 755 ; CHECK: G_BR %bb.56 756 ; CHECK: bb.48.bb49: 757 ; CHECK: successors: %bb.56(0x80000000) 758 ; CHECK: G_BR %bb.56 759 ; CHECK: bb.49.bb50: 760 ; CHECK: successors: %bb.56(0x80000000) 761 ; CHECK: G_BR %bb.56 762 ; CHECK: bb.50.bb51: 763 ; CHECK: successors: %bb.56(0x80000000) 764 ; CHECK: G_BR %bb.56 765 ; CHECK: bb.51.bb52: 766 ; CHECK: successors: %bb.56(0x80000000) 767 ; CHECK: G_BR %bb.56 768 ; CHECK: bb.52.bb53: 769 ; CHECK: successors: %bb.56(0x80000000) 770 ; CHECK: G_BR %bb.56 771 ; CHECK: bb.53.bb54: 772 ; CHECK: successors: %bb.56(0x80000000) 773 ; CHECK: G_BR %bb.56 774 ; CHECK: bb.54.bb55: 775 ; CHECK: successors: %bb.56(0x80000000) 776 ; CHECK: G_BR %bb.56 777 ; CHECK: bb.55.bb56: 778 ; CHECK: successors: %bb.56(0x80000000) 779 ; CHECK: bb.56.bb57: 780 ; CHECK: successors: %bb.59(0x80000000) 781 ; CHECK: [[PHI:%[0-9]+]]:_(s64) = G_PHI [[C56]](s64), %bb.1, [[C57]](s64), %bb.2, [[C58]](s64), %bb.3, [[C59]](s64), %bb.4, [[C60]](s64), %bb.5, [[C61]](s64), %bb.6, [[C62]](s64), %bb.7, [[C63]](s64), %bb.8, [[C64]](s64), %bb.9, [[C65]](s64), %bb.10, [[C66]](s64), %bb.11, [[C67]](s64), %bb.12, [[C68]](s64), %bb.13, [[C69]](s64), %bb.14, [[C70]](s64), %bb.15, [[C71]](s64), %bb.16, [[C72]](s64), %bb.17, [[C73]](s64), %bb.18, [[C74]](s64), %bb.19, [[C75]](s64), %bb.20, [[C76]](s64), %bb.21, [[C77]](s64), %bb.22, [[C78]](s64), %bb.23, [[C79]](s64), %bb.24, [[C80]](s64), %bb.25, [[C81]](s64), %bb.26, [[C82]](s64), %bb.27, [[C83]](s64), %bb.28, [[C84]](s64), %bb.29, [[C85]](s64), %bb.30, [[C86]](s64), %bb.31, [[C87]](s64), %bb.32, [[C88]](s64), %bb.33, [[C89]](s64), %bb.34, [[C90]](s64), %bb.35, [[C91]](s64), %bb.36, [[C92]](s64), %bb.37, [[C93]](s64), %bb.38, [[C94]](s64), %bb.39, [[C95]](s64), %bb.40, [[C96]](s64), %bb.41, [[C97]](s64), %bb.42, [[C98]](s64), %bb.43, [[C99]](s64), %bb.44, [[C100]](s64), %bb.45, [[C101]](s64), %bb.46, [[C102]](s64), %bb.47, [[C103]](s64), %bb.48, [[C104]](s64), %bb.49, [[C105]](s64), %bb.50, [[C106]](s64), %bb.51, [[C107]](s64), %bb.52, [[C108]](s64), %bb.53, [[C109]](s64), %bb.54, [[C110]](s64), %bb.55 782 ; CHECK: [[C111:%[0-9]+]]:_(s64) = G_CONSTANT i64 16 783 ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[PHI]], [[C111]] 784 ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[GV]], [[MUL]](s64) 785 ; CHECK: [[C112:%[0-9]+]]:_(s64) = G_CONSTANT i64 8 786 ; CHECK: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[PTR_ADD]], [[C112]](s64) 787 ; CHECK: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[PTR_ADD1]](p0) :: (load 8 from %ir.tmp59) 788 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp 789 ; CHECK: $x0 = COPY [[COPY]](p0) 790 ; CHECK: $x1 = COPY [[LOAD]](p0) 791 ; CHECK: BL @wibble, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit-def $x0 792 ; CHECK: [[COPY3:%[0-9]+]]:_(p0) = COPY $x0 793 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp 794 ; CHECK: G_BR %bb.59 795 ; CHECK: bb.57.bb62: 796 ; CHECK: successors: %bb.59(0x80000000) 797 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp 798 ; CHECK: $x0 = COPY [[COPY]](p0) 799 ; CHECK: $x1 = COPY [[COPY2]](p0) 800 ; CHECK: BL @wibble, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit-def $x0 801 ; CHECK: [[COPY4:%[0-9]+]]:_(p0) = COPY $x0 802 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp 803 ; CHECK: G_BR %bb.59 804 ; CHECK: bb.58.bb64: 805 ; CHECK: successors: %bb.59(0x80000000) 806 ; CHECK: [[COPY5:%[0-9]+]]:_(p0) = COPY [[FRAME_INDEX]](p0) 807 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp 808 ; CHECK: $w0 = COPY [[COPY1]](s32) 809 ; CHECK: $x1 = COPY [[COPY5]](p0) 810 ; CHECK: BL @baz, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $x1 811 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp 812 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp 813 ; CHECK: $x0 = COPY [[COPY]](p0) 814 ; CHECK: $x1 = COPY [[COPY5]](p0) 815 ; CHECK: BL @wibble, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit-def $x0 816 ; CHECK: [[COPY6:%[0-9]+]]:_(p0) = COPY $x0 817 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp 818 ; CHECK: bb.59.bb68: 819 ; CHECK: RET_ReallyLR 820 ; CHECK: bb.60.bb69: 821 ; CHECK: successors: %bb.58(0x40000000), %bb.57(0x40000000) 822 ; CHECK: [[ICMP55:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY2]](p0), [[C55]] 823 ; CHECK: G_BRCOND [[ICMP55]](s1), %bb.58 824 ; CHECK: G_BR %bb.57 825bb: 826 %tmp = alloca [16 x i32], align 4 827 switch i32 %arg1, label %bb69 [ 828 i32 3, label %bb57 829 i32 4, label %bb3 830 i32 6, label %bb4 831 i32 7, label %bb5 832 i32 8, label %bb6 833 i32 9, label %bb7 834 i32 10, label %bb8 835 i32 11, label %bb9 836 i32 12, label %bb10 837 i32 13, label %bb11 838 i32 14, label %bb12 839 i32 15, label %bb13 840 i32 16, label %bb14 841 i32 17, label %bb15 842 i32 18, label %bb16 843 i32 19, label %bb17 844 i32 20, label %bb18 845 i32 21, label %bb19 846 i32 22, label %bb20 847 i32 23, label %bb21 848 i32 24, label %bb22 849 i32 25, label %bb23 850 i32 26, label %bb24 851 i32 27, label %bb25 852 i32 28, label %bb26 853 i32 29, label %bb27 854 i32 30, label %bb28 855 i32 31, label %bb29 856 i32 32, label %bb30 857 i32 33, label %bb31 858 i32 34, label %bb32 859 i32 35, label %bb33 860 i32 36, label %bb34 861 i32 37, label %bb35 862 i32 38, label %bb36 863 i32 39, label %bb37 864 i32 41, label %bb38 865 i32 42, label %bb39 866 i32 43, label %bb40 867 i32 44, label %bb41 868 i32 45, label %bb42 869 i32 46, label %bb43 870 i32 47, label %bb44 871 i32 48, label %bb45 872 i32 49, label %bb46 873 i32 50, label %bb47 874 i32 51, label %bb48 875 i32 52, label %bb49 876 i32 53, label %bb50 877 i32 54, label %bb51 878 i32 55, label %bb52 879 i32 4352, label %bb53 880 i32 4353, label %bb54 881 i32 4354, label %bb55 882 i32 4355, label %bb56 883 ] 884 885bb3: ; preds = %bb 886 br label %bb57 887 888bb4: ; preds = %bb 889 br label %bb57 890 891bb5: ; preds = %bb 892 br label %bb57 893 894bb6: ; preds = %bb 895 br label %bb57 896 897bb7: ; preds = %bb 898 br label %bb57 899 900bb8: ; preds = %bb 901 br label %bb57 902 903bb9: ; preds = %bb 904 br label %bb57 905 906bb10: ; preds = %bb 907 br label %bb57 908 909bb11: ; preds = %bb 910 br label %bb57 911 912bb12: ; preds = %bb 913 br label %bb57 914 915bb13: ; preds = %bb 916 br label %bb57 917 918bb14: ; preds = %bb 919 br label %bb57 920 921bb15: ; preds = %bb 922 br label %bb57 923 924bb16: ; preds = %bb 925 br label %bb57 926 927bb17: ; preds = %bb 928 br label %bb57 929 930bb18: ; preds = %bb 931 br label %bb57 932 933bb19: ; preds = %bb 934 br label %bb57 935 936bb20: ; preds = %bb 937 br label %bb57 938 939bb21: ; preds = %bb 940 br label %bb57 941 942bb22: ; preds = %bb 943 br label %bb57 944 945bb23: ; preds = %bb 946 br label %bb57 947 948bb24: ; preds = %bb 949 br label %bb57 950 951bb25: ; preds = %bb 952 br label %bb57 953 954bb26: ; preds = %bb 955 br label %bb57 956 957bb27: ; preds = %bb 958 br label %bb57 959 960bb28: ; preds = %bb 961 br label %bb57 962 963bb29: ; preds = %bb 964 br label %bb57 965 966bb30: ; preds = %bb 967 br label %bb57 968 969bb31: ; preds = %bb 970 br label %bb57 971 972bb32: ; preds = %bb 973 br label %bb57 974 975bb33: ; preds = %bb 976 br label %bb57 977 978bb34: ; preds = %bb 979 br label %bb57 980 981bb35: ; preds = %bb 982 br label %bb57 983 984bb36: ; preds = %bb 985 br label %bb57 986 987bb37: ; preds = %bb 988 br label %bb57 989 990bb38: ; preds = %bb 991 br label %bb57 992 993bb39: ; preds = %bb 994 br label %bb57 995 996bb40: ; preds = %bb 997 br label %bb57 998 999bb41: ; preds = %bb 1000 br label %bb57 1001 1002bb42: ; preds = %bb 1003 br label %bb57 1004 1005bb43: ; preds = %bb 1006 br label %bb57 1007 1008bb44: ; preds = %bb 1009 br label %bb57 1010 1011bb45: ; preds = %bb 1012 br label %bb57 1013 1014bb46: ; preds = %bb 1015 br label %bb57 1016 1017bb47: ; preds = %bb 1018 br label %bb57 1019 1020bb48: ; preds = %bb 1021 br label %bb57 1022 1023bb49: ; preds = %bb 1024 br label %bb57 1025 1026bb50: ; preds = %bb 1027 br label %bb57 1028 1029bb51: ; preds = %bb 1030 br label %bb57 1031 1032bb52: ; preds = %bb 1033 br label %bb57 1034 1035bb53: ; preds = %bb 1036 br label %bb57 1037 1038bb54: ; preds = %bb 1039 br label %bb57 1040 1041bb55: ; preds = %bb 1042 br label %bb57 1043 1044bb56: ; preds = %bb 1045 br label %bb57 1046 1047bb57: ; preds = %bb56, %bb55, %bb54, %bb53, %bb52, %bb51, %bb50, %bb49, %bb48, %bb47, %bb46, %bb45, %bb44, %bb43, %bb42, %bb41, %bb40, %bb39, %bb38, %bb37, %bb36, %bb35, %bb34, %bb33, %bb32, %bb31, %bb30, %bb29, %bb28, %bb27, %bb26, %bb25, %bb24, %bb23, %bb22, %bb21, %bb20, %bb19, %bb18, %bb17, %bb16, %bb15, %bb14, %bb13, %bb12, %bb11, %bb10, %bb9, %bb8, %bb7, %bb6, %bb5, %bb4, %bb3, %bb 1048 %tmp58 = phi i64 [ 0, %bb ], [ 1, %bb3 ], [ 2, %bb4 ], [ 3, %bb5 ], [ 4, %bb6 ], [ 5, %bb7 ], [ 6, %bb8 ], [ 7, %bb9 ], [ 8, %bb10 ], [ 9, %bb11 ], [ 10, %bb12 ], [ 11, %bb13 ], [ 12, %bb14 ], [ 13, %bb15 ], [ 14, %bb16 ], [ 15, %bb17 ], [ 16, %bb18 ], [ 17, %bb19 ], [ 18, %bb20 ], [ 19, %bb21 ], [ 20, %bb22 ], [ 21, %bb23 ], [ 22, %bb24 ], [ 23, %bb25 ], [ 24, %bb26 ], [ 25, %bb27 ], [ 26, %bb28 ], [ 27, %bb29 ], [ 28, %bb30 ], [ 29, %bb31 ], [ 30, %bb32 ], [ 31, %bb33 ], [ 32, %bb34 ], [ 33, %bb35 ], [ 34, %bb36 ], [ 35, %bb37 ], [ 36, %bb38 ], [ 37, %bb39 ], [ 38, %bb40 ], [ 39, %bb41 ], [ 40, %bb42 ], [ 41, %bb43 ], [ 42, %bb44 ], [ 43, %bb45 ], [ 44, %bb46 ], [ 45, %bb47 ], [ 46, %bb48 ], [ 47, %bb49 ], [ 48, %bb50 ], [ 49, %bb51 ], [ 50, %bb52 ], [ 51, %bb53 ], [ 52, %bb54 ], [ 53, %bb55 ], [ 54, %bb56 ] 1049 %tmp59 = getelementptr inbounds [55 x %0], [55 x %0]* @global, i64 0, i64 %tmp58, i32 1 1050 %tmp60 = load i32*, i32** %tmp59, align 8 1051 %tmp61 = call %1* @wibble(%1* %arg, i32* %tmp60) 1052 br label %bb68 1053 1054bb62: ; preds = %bb69 1055 %tmp63 = call %1* @wibble(%1* %arg, i32* nonnull %arg2) 1056 br label %bb68 1057 1058bb64: ; preds = %bb69 1059 %tmp65 = bitcast [16 x i32]* %tmp to i8* 1060 %tmp66 = getelementptr inbounds [16 x i32], [16 x i32]* %tmp, i64 0, i64 0 1061 call void @baz(i32 %arg1, i32* %tmp66) 1062 %tmp67 = call %1* @wibble(%1* %arg, i32* %tmp66) 1063 br label %bb68 1064 1065bb68: ; preds = %bb64, %bb62, %bb57 1066 ret void 1067 1068bb69: ; preds = %bb 1069 %tmp70 = icmp eq i32* %arg2, null 1070 br i1 %tmp70, label %bb64, label %bb62 1071} 1072 1073declare %1* @wibble(%1* returned, i32*) 1074 1075declare void @baz(i32, i32*) 1076 1077 1078; Check that with 2 jump tables, the phi node doesn't lose the edge from the 1079; second one. 1080define void @jt_2_tables_phi_edge_from_second() { 1081 ; CHECK-LABEL: name: jt_2_tables_phi_edge_from_second 1082 ; CHECK: bb.1.entry: 1083 ; CHECK: successors: %bb.6(0x40000000), %bb.19(0x40000000) 1084 ; CHECK: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF 1085 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 123 1086 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 263 1087 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 265 1088 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 270 1089 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 279 1090 ; CHECK: [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF 1091 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 37 1092 ; CHECK: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 43 1093 ; CHECK: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 45 1094 ; CHECK: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 60 1095 ; CHECK: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 278 1096 ; CHECK: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 280 1097 ; CHECK: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 281 1098 ; CHECK: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 283 1099 ; CHECK: [[DEF2:%[0-9]+]]:_(s1) = G_IMPLICIT_DEF 1100 ; CHECK: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 1101 ; CHECK: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 1102 ; CHECK: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 1103 ; CHECK: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 1104 ; CHECK: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 1105 ; CHECK: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 1106 ; CHECK: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 1107 ; CHECK: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 12 1108 ; CHECK: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 15 1109 ; CHECK: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[DEF]](p0) :: (load 4 from `i32* undef`, align 8) 1110 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C]] 1111 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.6 1112 ; CHECK: G_BR %bb.19 1113 ; CHECK: bb.19.entry: 1114 ; CHECK: successors: %bb.4(0x40000000), %bb.20(0x40000000) 1115 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C1]] 1116 ; CHECK: G_BRCOND [[ICMP1]](s1), %bb.4 1117 ; CHECK: G_BR %bb.20 1118 ; CHECK: bb.20.entry: 1119 ; CHECK: successors: %bb.7(0x40000000), %bb.21(0x40000000) 1120 ; CHECK: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C2]] 1121 ; CHECK: G_BRCOND [[ICMP2]](s1), %bb.7 1122 ; CHECK: G_BR %bb.21 1123 ; CHECK: bb.21.entry: 1124 ; CHECK: successors: %bb.2(0x40000000), %bb.22(0x40000000) 1125 ; CHECK: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C3]] 1126 ; CHECK: G_BRCOND [[ICMP3]](s1), %bb.2 1127 ; CHECK: G_BR %bb.22 1128 ; CHECK: bb.22.entry: 1129 ; CHECK: successors: %bb.5(0x40000000), %bb.23(0x40000000) 1130 ; CHECK: [[ICMP4:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C4]] 1131 ; CHECK: G_BRCOND [[ICMP4]](s1), %bb.5 1132 ; CHECK: G_BR %bb.23 1133 ; CHECK: bb.23.entry: 1134 ; CHECK: successors: %bb.3(0x80000000) 1135 ; CHECK: G_BR %bb.3 1136 ; CHECK: bb.2.if.then: 1137 ; CHECK: successors: 1138 ; CHECK: bb.3.sw.bb2.i41: 1139 ; CHECK: successors: 1140 ; CHECK: bb.4.sw.bb7.i44: 1141 ; CHECK: successors: 1142 ; CHECK: bb.5.sw.bb8.i45: 1143 ; CHECK: successors: 1144 ; CHECK: bb.6.sw.bb13.i47: 1145 ; CHECK: successors: 1146 ; CHECK: bb.7.sw.bb14.i48: 1147 ; CHECK: successors: %bb.10(0x40000000), %bb.24(0x40000000) 1148 ; CHECK: [[ICMP5:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C5]] 1149 ; CHECK: G_BRCOND [[ICMP5]](s1), %bb.10 1150 ; CHECK: G_BR %bb.24 1151 ; CHECK: bb.24.sw.bb14.i48: 1152 ; CHECK: successors: %bb.16(0x40000000), %bb.25(0x40000000) 1153 ; CHECK: [[ICMP6:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C6]] 1154 ; CHECK: G_BRCOND [[ICMP6]](s1), %bb.16 1155 ; CHECK: G_BR %bb.25 1156 ; CHECK: bb.25.sw.bb14.i48: 1157 ; CHECK: successors: %bb.9(0x40000000), %bb.26(0x40000000) 1158 ; CHECK: [[ICMP7:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C7]] 1159 ; CHECK: G_BRCOND [[ICMP7]](s1), %bb.9 1160 ; CHECK: G_BR %bb.26 1161 ; CHECK: bb.26.sw.bb14.i48: 1162 ; CHECK: successors: %bb.14(0x40000000), %bb.27(0x40000000) 1163 ; CHECK: [[ICMP8:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C8]] 1164 ; CHECK: G_BRCOND [[ICMP8]](s1), %bb.14 1165 ; CHECK: G_BR %bb.27 1166 ; CHECK: bb.27.sw.bb14.i48: 1167 ; CHECK: successors: %bb.11(0x40000000), %bb.28(0x40000000) 1168 ; CHECK: [[ICMP9:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C9]] 1169 ; CHECK: G_BRCOND [[ICMP9]](s1), %bb.11 1170 ; CHECK: G_BR %bb.28 1171 ; CHECK: bb.28.sw.bb14.i48: 1172 ; CHECK: successors: %bb.13(0x40000000), %bb.29(0x40000000) 1173 ; CHECK: [[ICMP10:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C10]] 1174 ; CHECK: G_BRCOND [[ICMP10]](s1), %bb.13 1175 ; CHECK: G_BR %bb.29 1176 ; CHECK: bb.29.sw.bb14.i48: 1177 ; CHECK: successors: %bb.15(0x40000000), %bb.30(0x40000000) 1178 ; CHECK: [[ICMP11:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C11]] 1179 ; CHECK: G_BRCOND [[ICMP11]](s1), %bb.15 1180 ; CHECK: G_BR %bb.30 1181 ; CHECK: bb.30.sw.bb14.i48: 1182 ; CHECK: successors: %bb.12(0x40000000), %bb.18(0x40000000) 1183 ; CHECK: [[ICMP12:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C12]] 1184 ; CHECK: G_BRCOND [[ICMP12]](s1), %bb.12 1185 ; CHECK: G_BR %bb.18 1186 ; CHECK: bb.8.sw.default.i49: 1187 ; CHECK: successors: 1188 ; CHECK: bb.9.sw.bb1.i: 1189 ; CHECK: successors: %bb.16(0x80000000) 1190 ; CHECK: G_BR %bb.16 1191 ; CHECK: bb.10.sw.bb4.i: 1192 ; CHECK: successors: %bb.16(0x80000000) 1193 ; CHECK: G_BR %bb.16 1194 ; CHECK: bb.11.sw.bb6.i: 1195 ; CHECK: successors: %bb.16(0x80000000) 1196 ; CHECK: G_BR %bb.16 1197 ; CHECK: bb.12.sw.bb7.i: 1198 ; CHECK: successors: %bb.16(0x80000000) 1199 ; CHECK: G_BR %bb.16 1200 ; CHECK: bb.13.sw.bb8.i: 1201 ; CHECK: successors: %bb.16(0x80000000) 1202 ; CHECK: G_BR %bb.16 1203 ; CHECK: bb.14.sw.bb9.i: 1204 ; CHECK: successors: %bb.16(0x80000000) 1205 ; CHECK: G_BR %bb.16 1206 ; CHECK: bb.15.sw.bb12.i: 1207 ; CHECK: successors: %bb.16(0x80000000) 1208 ; CHECK: bb.16.land.rhs.lr.ph: 1209 ; CHECK: successors: %bb.17(0x40000000), %bb.18(0x40000000) 1210 ; CHECK: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C13]](s32), %bb.24, [[C14]](s32), %bb.9, [[C15]](s32), %bb.10, [[C16]](s32), %bb.11, [[C17]](s32), %bb.12, [[C18]](s32), %bb.13, [[C19]](s32), %bb.14, [[C20]](s32), %bb.15 1211 ; CHECK: G_BRCOND [[DEF2]](s1), %bb.17 1212 ; CHECK: G_BR %bb.18 1213 ; CHECK: bb.17.while.body: 1214 ; CHECK: successors: 1215 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp 1216 ; CHECK: BL @jt_2_tables_phi_edge_from_second, csr_aarch64_aapcs, implicit-def $lr, implicit $sp 1217 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp 1218 ; CHECK: bb.18.while.end: 1219 ; CHECK: [[PHI1:%[0-9]+]]:_(s32) = G_PHI [[C21]](s32), %bb.30, [[PHI]](s32), %bb.16 1220 ; CHECK: RET_ReallyLR 1221entry: 1222 %0 = load i32, i32* undef, align 8 1223 switch i32 %0, label %sw.default.i49 [ 1224 i32 270, label %if.then 1225 i32 265, label %sw.bb14.i48 1226 i32 123, label %sw.bb13.i47 1227 i32 279, label %sw.bb8.i45 1228 i32 286, label %sw.bb2.i41 1229 i32 263, label %sw.bb7.i44 1230 ] 1231 1232if.then: ; preds = %entry 1233 unreachable 1234 1235sw.bb2.i41: ; preds = %entry 1236 unreachable 1237 1238sw.bb7.i44: ; preds = %entry 1239 unreachable 1240 1241sw.bb8.i45: ; preds = %entry 1242 unreachable 1243 1244sw.bb13.i47: ; preds = %entry 1245 unreachable 1246 1247sw.bb14.i48: ; preds = %entry 1248 switch i32 undef, label %while.end [ 1249 i32 43, label %land.rhs.lr.ph 1250 i32 45, label %sw.bb1.i 1251 i32 280, label %sw.bb8.i 1252 i32 60, label %sw.bb9.i 1253 i32 37, label %sw.bb4.i 1254 i32 281, label %sw.bb12.i 1255 i32 278, label %sw.bb6.i 1256 i32 283, label %sw.bb7.i 1257 ] 1258 1259sw.default.i49: ; preds = %entry 1260 unreachable 1261 1262sw.bb1.i: ; preds = %sw.bb14.i48 1263 br label %land.rhs.lr.ph 1264 1265sw.bb4.i: ; preds = %sw.bb14.i48 1266 br label %land.rhs.lr.ph 1267 1268sw.bb6.i: ; preds = %sw.bb14.i48 1269 br label %land.rhs.lr.ph 1270 1271sw.bb7.i: ; preds = %sw.bb14.i48 1272 br label %land.rhs.lr.ph 1273 1274sw.bb8.i: ; preds = %sw.bb14.i48 1275 br label %land.rhs.lr.ph 1276 1277sw.bb9.i: ; preds = %sw.bb14.i48 1278 br label %land.rhs.lr.ph 1279 1280sw.bb12.i: ; preds = %sw.bb14.i48 1281 br label %land.rhs.lr.ph 1282 1283land.rhs.lr.ph: ; preds = %sw.bb12.i, %sw.bb9.i, %sw.bb8.i, %sw.bb7.i, %sw.bb6.i, %sw.bb4.i, %sw.bb1.i, %sw.bb14.i48 1284 %retval.0.i.ph = phi i32 [ 0, %sw.bb14.i48 ], [ 1, %sw.bb1.i ], [ 4, %sw.bb4.i ], [ 6, %sw.bb6.i ], [ 7, %sw.bb7.i ], [ 8, %sw.bb8.i ], [ 9, %sw.bb9.i ], [ 12, %sw.bb12.i ] 1285 br i1 undef, label %while.body, label %while.end 1286 1287while.body: ; preds = %land.rhs.lr.ph 1288 call void @jt_2_tables_phi_edge_from_second() 1289 unreachable 1290 1291while.end: ; preds = %land.rhs.lr.ph, %sw.bb14.i48 1292 %op.0.lcssa = phi i32 [ 15, %sw.bb14.i48 ], [ %retval.0.i.ph, %land.rhs.lr.ph ] 1293 ret void 1294} 1295 1296 1297define i32 @range_test(i32 %x) { 1298 ; CHECK-LABEL: name: range_test 1299 ; CHECK: bb.1.entry: 1300 ; CHECK: successors: %bb.3(0x40000000), %bb.5(0x40000000) 1301 ; CHECK: liveins: $w0 1302 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 1303 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 1304 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24 1305 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 1306 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 42 1307 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 1308 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]] 1309 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.3 1310 ; CHECK: G_BR %bb.5 1311 ; CHECK: bb.5.entry: 1312 ; CHECK: successors: %bb.2(0x40000000), %bb.4(0x40000000) 1313 ; CHECK: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[C1]] 1314 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 1315 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ule), [[SUB]](s32), [[C5]] 1316 ; CHECK: G_BRCOND [[ICMP1]](s1), %bb.2 1317 ; CHECK: G_BR %bb.4 1318 ; CHECK: bb.2.sw.bb: 1319 ; CHECK: successors: %bb.4(0x80000000) 1320 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = nsw G_ADD [[COPY]], [[C3]] 1321 ; CHECK: G_BR %bb.4 1322 ; CHECK: bb.3.sw.bb1: 1323 ; CHECK: successors: %bb.4(0x80000000) 1324 ; CHECK: [[MUL:%[0-9]+]]:_(s32) = nsw G_MUL [[COPY]], [[C2]] 1325 ; CHECK: bb.4.return: 1326 ; CHECK: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[MUL]](s32), %bb.3, [[ADD]](s32), %bb.2, [[C4]](s32), %bb.5 1327 ; CHECK: $w0 = COPY [[PHI]](s32) 1328 ; CHECK: RET_ReallyLR implicit $w0 1329entry: 1330 switch i32 %x, label %return [ 1331 i32 24, label %sw.bb 1332 i32 25, label %sw.bb 1333 i32 26, label %sw.bb 1334 i32 6, label %sw.bb1 1335 ] 1336 1337sw.bb: 1338 %add = add nsw i32 %x, 42 1339 br label %return 1340 1341sw.bb1: 1342 %mul = mul nsw i32 %x, 3 1343 br label %return 1344 1345return: 1346 %retval.0 = phi i32 [ %mul, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ] 1347 ret i32 %retval.0 1348} 1349 1350define i64* @test_range_phi_switch_cycle() { 1351 ; CHECK-LABEL: name: test_range_phi_switch_cycle 1352 ; CHECK: bb.1.bb: 1353 ; CHECK: successors: %bb.2(0x80000000) 1354 ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF 1355 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 305 1356 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 307 1357 ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 497 1358 ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 1359 ; CHECK: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 1360 ; CHECK: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 1361 ; CHECK: bb.2.bb1: 1362 ; CHECK: successors: %bb.2(0x40000000), %bb.6(0x40000000) 1363 ; CHECK: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[DEF]](s32), %bb.1, [[C3]](s32), %bb.3, [[C4]](s32), %bb.4, [[C5]](s32), %bb.2 1364 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C]] 1365 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.2 1366 ; CHECK: G_BR %bb.6 1367 ; CHECK: bb.6.bb1: 1368 ; CHECK: successors: %bb.3(0x40000000), %bb.7(0x40000000) 1369 ; CHECK: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C1]] 1370 ; CHECK: G_BRCOND [[ICMP1]](s1), %bb.3 1371 ; CHECK: G_BR %bb.7 1372 ; CHECK: bb.7.bb1: 1373 ; CHECK: successors: %bb.4(0x40000000), %bb.5(0x40000000) 1374 ; CHECK: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C2]] 1375 ; CHECK: G_BRCOND [[ICMP2]](s1), %bb.4 1376 ; CHECK: G_BR %bb.5 1377 ; CHECK: bb.3.bb2: 1378 ; CHECK: successors: %bb.2(0x80000000) 1379 ; CHECK: G_BR %bb.2 1380 ; CHECK: bb.4.bb3: 1381 ; CHECK: successors: %bb.2(0x80000000) 1382 ; CHECK: G_BR %bb.2 1383 ; CHECK: bb.5.bb4: 1384 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp 1385 ; CHECK: $w0 = COPY [[PHI]](s32) 1386 ; CHECK: BL @ham, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit-def $x0 1387 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 1388 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp 1389bb: 1390 br label %bb1 1391 1392bb1: ; preds = %bb3, %bb2, %bb1, %bb 1393 %tmp = phi i32 [undef, %bb ], [ 4, %bb2 ], [ 3, %bb3 ], [ 1, %bb1] 1394 switch i32 undef, label %bb4 [ 1395 i32 305, label %bb1 1396 i32 497, label %bb3 1397 i32 307, label %bb2 1398 ] 1399 1400bb2: ; preds = %bb1 1401 br label %bb1 1402 1403bb3: ; preds = %bb1 1404 br label %bb1 1405 1406bb4: ; preds = %bb1 1407 %tmp5 = tail call i64* @ham(i32 %tmp) 1408 unreachable 1409} 1410 1411declare i64* @ham(i32) 1412 1413define internal void @bar() unnamed_addr #1 { 1414 ; CHECK-LABEL: name: bar 1415 ; CHECK: bb.1 (%ir-block.0): 1416 unreachable 1417} 1418 1419define i1 @i1_value_cmp_is_signed(i1) { 1420 ; CHECK-LABEL: name: i1_value_cmp_is_signed 1421 ; CHECK: bb.1.Entry: 1422 ; CHECK: successors: %bb.3(0x40000000), %bb.2(0x40000000) 1423 ; CHECK: liveins: $w0 1424 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 1425 ; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY]](s32) 1426 ; CHECK: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 true 1427 ; CHECK: [[C1:%[0-9]+]]:_(s1) = G_CONSTANT i1 false 1428 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(sle), [[TRUNC]](s1), [[C1]] 1429 ; CHECK: G_BRCOND [[ICMP]](s1), %bb.3 1430 ; CHECK: G_BR %bb.2 1431 ; CHECK: bb.2.BadValue: 1432 ; CHECK: successors: 1433 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp 1434 ; CHECK: BL @bar, csr_aarch64_aapcs, implicit-def $lr, implicit $sp 1435 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp 1436 ; CHECK: bb.3.OkValue: 1437 ; CHECK: [[ZEXT:%[0-9]+]]:_(s8) = G_ZEXT [[TRUNC]](s1) 1438 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ZEXT]](s8) 1439 ; CHECK: $w0 = COPY [[ANYEXT]](s32) 1440 ; CHECK: RET_ReallyLR implicit $w0 1441Entry: 1442 switch i1 %0, label %BadValue [ 1443 i1 false, label %OkValue 1444 i1 true, label %OkValue 1445 ] 1446 1447BadValue: 1448 call fastcc void @bar() 1449 unreachable 1450 1451OkValue: 1452 ret i1 %0 1453} 1454 1455