; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
; RUN: llc -global-isel -mtriple aarch64 -aarch64-min-jump-table-entries=4 -O0 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -simplify-mir -verify-machineinstrs %s -o - 2>&1 | FileCheck %s
define i32 @switch(i32 %argc) {
; CHECK-LABEL: name: switch
; CHECK: bb.1.entry:
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 100
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 200
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
; CHECK-NEXT: G_BR %bb.6
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.6.entry:
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]]
; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.4
; CHECK-NEXT: G_BR %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.default:
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C4]]
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.case100:
; CHECK-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C3]]
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.case200:
; CHECK-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C2]]
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.return:
; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[ADD]](s32), %bb.2, [[ADD1]](s32), %bb.3, [[ADD2]](s32), %bb.4
; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
entry:
switch i32 %argc, label %default [
i32 100, label %case100
i32 200, label %case200
]
default:
%tmp0 = add i32 %argc, 0
br label %return
case100:
%tmp1 = add i32 %argc, 1
br label %return
case200:
%tmp2 = add i32 %argc, 2
br label %return
return:
%res = phi i32 [ %tmp0, %default ], [ %tmp1, %case100 ], [ %tmp2, %case200 ]
ret i32 %res
}
define i32 @test_cfg_remap(i32 %in) {
; CHECK-LABEL: name: test_cfg_remap
; CHECK: bb.1.entry:
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 57
; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.2
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.entry:
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]]
; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.3
; CHECK-NEXT: G_BR %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.next:
; CHECK-NEXT: G_BR %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.other:
; CHECK-NEXT: $w0 = COPY [[DEF]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.phi.block:
; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C]](s32), %bb.5, [[C2]](s32), %bb.2
; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
entry:
switch i32 %in, label %phi.block [i32 1, label %next
i32 57, label %other]
next:
br label %phi.block
other:
ret i32 undef
phi.block:
%res = phi i32 [1, %entry], [42, %next]
ret i32 %res
}
define i32 @test_cfg_remap_multiple_preds(i32 %in) {
; CHECK-LABEL: name: test_cfg_remap_multiple_preds
; CHECK: bb.1.entry:
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 57
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 128
; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
; CHECK-NEXT: G_BR %bb.6
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.6.entry:
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C1]]
; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.4
; CHECK-NEXT: G_BR %bb.7
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.7.entry:
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C2]]
; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.5
; CHECK-NEXT: G_BR %bb.8
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.8.entry:
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.odd:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.next:
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.other:
; CHECK-NEXT: $w0 = COPY [[DEF]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.phi.block:
; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[C]](s32), %bb.7, [[C]](s32), %bb.8, [[C4]](s32), %bb.3
; CHECK-NEXT: $w0 = COPY [[C3]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
entry:
switch i32 %in, label %odd [i32 1, label %next
i32 57, label %other
i32 128, label %phi.block
i32 256, label %phi.block]
odd:
unreachable
next:
br label %phi.block
other:
ret i32 undef
phi.block:
%res = phi i32 [1, %entry], [1, %entry], [42, %next]
ret i32 12
}
define i32 @jt_test(i32 %x) {
; CHECK-LABEL: name: jt_test
; CHECK: bb.1.entry:
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 71
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[C4]]
; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[SUB]](s32)
; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[C]](s32)
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ugt), [[ZEXT]](s64), [[ZEXT1]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.entry:
; CHECK-NEXT: successors: %bb.3, %bb.4, %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[JUMP_TABLE:%[0-9]+]]:_(p0) = G_JUMP_TABLE %jump-table.0
; CHECK-NEXT: G_BRJT [[JUMP_TABLE]](p0), %jump-table.0, [[ZEXT]](s64)
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.sw.bb:
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = nsw G_ADD [[COPY]], [[C2]]
; CHECK-NEXT: G_BR %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.sw.bb1:
; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = nsw G_MUL [[COPY]], [[C1]]
; CHECK-NEXT: G_BR %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.return:
; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[MUL]](s32), %bb.3, [[ADD]](s32), %bb.2, [[C3]](s32), %bb.1, [[C3]](s32), %bb.5
; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
entry:
switch i32 %x, label %return [
i32 75, label %sw.bb
i32 34, label %sw.bb
i32 56, label %sw.bb
i32 35, label %sw.bb
i32 40, label %sw.bb
i32 4, label %sw.bb1
i32 5, label %sw.bb1
i32 6, label %sw.bb1
]
sw.bb:
%add = add nsw i32 %x, 42
br label %return
sw.bb1:
%mul = mul nsw i32 %x, 3
br label %return
return:
%retval.0 = phi i32 [ %mul, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ]
ret i32 %retval.0
}
%0 = type { i32, ptr }
%1 = type { ptr, i32, i32 }
@global = external hidden constant [55 x %0], align 8
define void @jt_multiple_jump_tables(ptr %arg, i32 %arg1, ptr %arg2) {
; CHECK-LABEL: name: jt_multiple_jump_tables
; CHECK: bb.1.bb:
; CHECK-NEXT: liveins: $w1, $x0, $x2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x2
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 9
; CHECK-NEXT: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 10
; CHECK-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 11
; CHECK-NEXT: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
; CHECK-NEXT: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 13
; CHECK-NEXT: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 14
; CHECK-NEXT: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
; CHECK-NEXT: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
; CHECK-NEXT: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
; CHECK-NEXT: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 18
; CHECK-NEXT: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 19
; CHECK-NEXT: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
; CHECK-NEXT: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 21
; CHECK-NEXT: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 22
; CHECK-NEXT: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 23
; CHECK-NEXT: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
; CHECK-NEXT: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 25
; CHECK-NEXT: [[C22:%[0-9]+]]:_(s32) = G_CONSTANT i32 26
; CHECK-NEXT: [[C23:%[0-9]+]]:_(s32) = G_CONSTANT i32 27
; CHECK-NEXT: [[C24:%[0-9]+]]:_(s32) = G_CONSTANT i32 28
; CHECK-NEXT: [[C25:%[0-9]+]]:_(s32) = G_CONSTANT i32 29
; CHECK-NEXT: [[C26:%[0-9]+]]:_(s32) = G_CONSTANT i32 30
; CHECK-NEXT: [[C27:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
; CHECK-NEXT: [[C28:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
; CHECK-NEXT: [[C29:%[0-9]+]]:_(s32) = G_CONSTANT i32 33
; CHECK-NEXT: [[C30:%[0-9]+]]:_(s32) = G_CONSTANT i32 34
; CHECK-NEXT: [[C31:%[0-9]+]]:_(s32) = G_CONSTANT i32 35
; CHECK-NEXT: [[C32:%[0-9]+]]:_(s32) = G_CONSTANT i32 36
; CHECK-NEXT: [[C33:%[0-9]+]]:_(s32) = G_CONSTANT i32 37
; CHECK-NEXT: [[C34:%[0-9]+]]:_(s32) = G_CONSTANT i32 38
; CHECK-NEXT: [[C35:%[0-9]+]]:_(s32) = G_CONSTANT i32 39
; CHECK-NEXT: [[C36:%[0-9]+]]:_(s32) = G_CONSTANT i32 41
; CHECK-NEXT: [[C37:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
; CHECK-NEXT: [[C38:%[0-9]+]]:_(s32) = G_CONSTANT i32 43
; CHECK-NEXT: [[C39:%[0-9]+]]:_(s32) = G_CONSTANT i32 44
; CHECK-NEXT: [[C40:%[0-9]+]]:_(s32) = G_CONSTANT i32 45
; CHECK-NEXT: [[C41:%[0-9]+]]:_(s32) = G_CONSTANT i32 46
; CHECK-NEXT: [[C42:%[0-9]+]]:_(s32) = G_CONSTANT i32 47
; CHECK-NEXT: [[C43:%[0-9]+]]:_(s32) = G_CONSTANT i32 48
; CHECK-NEXT: [[C44:%[0-9]+]]:_(s32) = G_CONSTANT i32 49
; CHECK-NEXT: [[C45:%[0-9]+]]:_(s32) = G_CONSTANT i32 50
; CHECK-NEXT: [[C46:%[0-9]+]]:_(s32) = G_CONSTANT i32 51
; CHECK-NEXT: [[C47:%[0-9]+]]:_(s32) = G_CONSTANT i32 52
; CHECK-NEXT: [[C48:%[0-9]+]]:_(s32) = G_CONSTANT i32 53
; CHECK-NEXT: [[C49:%[0-9]+]]:_(s32) = G_CONSTANT i32 54
; CHECK-NEXT: [[C50:%[0-9]+]]:_(s32) = G_CONSTANT i32 55
; CHECK-NEXT: [[C51:%[0-9]+]]:_(s32) = G_CONSTANT i32 4352
; CHECK-NEXT: [[C52:%[0-9]+]]:_(s32) = G_CONSTANT i32 4353
; CHECK-NEXT: [[C53:%[0-9]+]]:_(s32) = G_CONSTANT i32 4354
; CHECK-NEXT: [[C54:%[0-9]+]]:_(s32) = G_CONSTANT i32 4355
; CHECK-NEXT: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @global
; CHECK-NEXT: [[C55:%[0-9]+]]:_(p0) = G_CONSTANT i64 0
; CHECK-NEXT: [[C56:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
; CHECK-NEXT: [[C57:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
; CHECK-NEXT: [[C58:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
; CHECK-NEXT: [[C59:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
; CHECK-NEXT: [[C60:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
; CHECK-NEXT: [[C61:%[0-9]+]]:_(s64) = G_CONSTANT i64 5
; CHECK-NEXT: [[C62:%[0-9]+]]:_(s64) = G_CONSTANT i64 6
; CHECK-NEXT: [[C63:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
; CHECK-NEXT: [[C64:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
; CHECK-NEXT: [[C65:%[0-9]+]]:_(s64) = G_CONSTANT i64 9
; CHECK-NEXT: [[C66:%[0-9]+]]:_(s64) = G_CONSTANT i64 10
; CHECK-NEXT: [[C67:%[0-9]+]]:_(s64) = G_CONSTANT i64 11
; CHECK-NEXT: [[C68:%[0-9]+]]:_(s64) = G_CONSTANT i64 12
; CHECK-NEXT: [[C69:%[0-9]+]]:_(s64) = G_CONSTANT i64 13
; CHECK-NEXT: [[C70:%[0-9]+]]:_(s64) = G_CONSTANT i64 14
; CHECK-NEXT: [[C71:%[0-9]+]]:_(s64) = G_CONSTANT i64 15
; CHECK-NEXT: [[C72:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
; CHECK-NEXT: [[C73:%[0-9]+]]:_(s64) = G_CONSTANT i64 17
; CHECK-NEXT: [[C74:%[0-9]+]]:_(s64) = G_CONSTANT i64 18
; CHECK-NEXT: [[C75:%[0-9]+]]:_(s64) = G_CONSTANT i64 19
; CHECK-NEXT: [[C76:%[0-9]+]]:_(s64) = G_CONSTANT i64 20
; CHECK-NEXT: [[C77:%[0-9]+]]:_(s64) = G_CONSTANT i64 21
; CHECK-NEXT: [[C78:%[0-9]+]]:_(s64) = G_CONSTANT i64 22
; CHECK-NEXT: [[C79:%[0-9]+]]:_(s64) = G_CONSTANT i64 23
; CHECK-NEXT: [[C80:%[0-9]+]]:_(s64) = G_CONSTANT i64 24
; CHECK-NEXT: [[C81:%[0-9]+]]:_(s64) = G_CONSTANT i64 25
; CHECK-NEXT: [[C82:%[0-9]+]]:_(s64) = G_CONSTANT i64 26
; CHECK-NEXT: [[C83:%[0-9]+]]:_(s64) = G_CONSTANT i64 27
; CHECK-NEXT: [[C84:%[0-9]+]]:_(s64) = G_CONSTANT i64 28
; CHECK-NEXT: [[C85:%[0-9]+]]:_(s64) = G_CONSTANT i64 29
; CHECK-NEXT: [[C86:%[0-9]+]]:_(s64) = G_CONSTANT i64 30
; CHECK-NEXT: [[C87:%[0-9]+]]:_(s64) = G_CONSTANT i64 31
; CHECK-NEXT: [[C88:%[0-9]+]]:_(s64) = G_CONSTANT i64 32
; CHECK-NEXT: [[C89:%[0-9]+]]:_(s64) = G_CONSTANT i64 33
; CHECK-NEXT: [[C90:%[0-9]+]]:_(s64) = G_CONSTANT i64 34
; CHECK-NEXT: [[C91:%[0-9]+]]:_(s64) = G_CONSTANT i64 35
; CHECK-NEXT: [[C92:%[0-9]+]]:_(s64) = G_CONSTANT i64 36
; CHECK-NEXT: [[C93:%[0-9]+]]:_(s64) = G_CONSTANT i64 37
; CHECK-NEXT: [[C94:%[0-9]+]]:_(s64) = G_CONSTANT i64 38
; CHECK-NEXT: [[C95:%[0-9]+]]:_(s64) = G_CONSTANT i64 39
; CHECK-NEXT: [[C96:%[0-9]+]]:_(s64) = G_CONSTANT i64 40
; CHECK-NEXT: [[C97:%[0-9]+]]:_(s64) = G_CONSTANT i64 41
; CHECK-NEXT: [[C98:%[0-9]+]]:_(s64) = G_CONSTANT i64 42
; CHECK-NEXT: [[C99:%[0-9]+]]:_(s64) = G_CONSTANT i64 43
; CHECK-NEXT: [[C100:%[0-9]+]]:_(s64) = G_CONSTANT i64 44
; CHECK-NEXT: [[C101:%[0-9]+]]:_(s64) = G_CONSTANT i64 45
; CHECK-NEXT: [[C102:%[0-9]+]]:_(s64) = G_CONSTANT i64 46
; CHECK-NEXT: [[C103:%[0-9]+]]:_(s64) = G_CONSTANT i64 47
; CHECK-NEXT: [[C104:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
; CHECK-NEXT: [[C105:%[0-9]+]]:_(s64) = G_CONSTANT i64 49
; CHECK-NEXT: [[C106:%[0-9]+]]:_(s64) = G_CONSTANT i64 50
; CHECK-NEXT: [[C107:%[0-9]+]]:_(s64) = G_CONSTANT i64 51
; CHECK-NEXT: [[C108:%[0-9]+]]:_(s64) = G_CONSTANT i64 52
; CHECK-NEXT: [[C109:%[0-9]+]]:_(s64) = G_CONSTANT i64 53
; CHECK-NEXT: [[C110:%[0-9]+]]:_(s64) = G_CONSTANT i64 54
; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0.tmp
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.56
; CHECK-NEXT: G_BR %bb.61
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.61.bb:
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C1]]
; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.2
; CHECK-NEXT: G_BR %bb.62
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.62.bb:
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C2]]
; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.3
; CHECK-NEXT: G_BR %bb.63
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.63.bb:
; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C3]]
; CHECK-NEXT: G_BRCOND [[ICMP3]](s1), %bb.4
; CHECK-NEXT: G_BR %bb.64
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.64.bb:
; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C4]]
; CHECK-NEXT: G_BRCOND [[ICMP4]](s1), %bb.5
; CHECK-NEXT: G_BR %bb.65
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.65.bb:
; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C5]]
; CHECK-NEXT: G_BRCOND [[ICMP5]](s1), %bb.6
; CHECK-NEXT: G_BR %bb.66
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.66.bb:
; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C6]]
; CHECK-NEXT: G_BRCOND [[ICMP6]](s1), %bb.7
; CHECK-NEXT: G_BR %bb.67
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.67.bb:
; CHECK-NEXT: [[ICMP7:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C7]]
; CHECK-NEXT: G_BRCOND [[ICMP7]](s1), %bb.8
; CHECK-NEXT: G_BR %bb.68
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.68.bb:
; CHECK-NEXT: [[ICMP8:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C8]]
; CHECK-NEXT: G_BRCOND [[ICMP8]](s1), %bb.9
; CHECK-NEXT: G_BR %bb.69
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.69.bb:
; CHECK-NEXT: [[ICMP9:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C9]]
; CHECK-NEXT: G_BRCOND [[ICMP9]](s1), %bb.10
; CHECK-NEXT: G_BR %bb.70
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.70.bb:
; CHECK-NEXT: [[ICMP10:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C10]]
; CHECK-NEXT: G_BRCOND [[ICMP10]](s1), %bb.11
; CHECK-NEXT: G_BR %bb.71
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.71.bb:
; CHECK-NEXT: [[ICMP11:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C11]]
; CHECK-NEXT: G_BRCOND [[ICMP11]](s1), %bb.12
; CHECK-NEXT: G_BR %bb.72
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.72.bb:
; CHECK-NEXT: [[ICMP12:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C12]]
; CHECK-NEXT: G_BRCOND [[ICMP12]](s1), %bb.13
; CHECK-NEXT: G_BR %bb.73
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.73.bb:
; CHECK-NEXT: [[ICMP13:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C13]]
; CHECK-NEXT: G_BRCOND [[ICMP13]](s1), %bb.14
; CHECK-NEXT: G_BR %bb.74
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.74.bb:
; CHECK-NEXT: [[ICMP14:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C14]]
; CHECK-NEXT: G_BRCOND [[ICMP14]](s1), %bb.15
; CHECK-NEXT: G_BR %bb.75
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.75.bb:
; CHECK-NEXT: [[ICMP15:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C15]]
; CHECK-NEXT: G_BRCOND [[ICMP15]](s1), %bb.16
; CHECK-NEXT: G_BR %bb.76
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.76.bb:
; CHECK-NEXT: [[ICMP16:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C16]]
; CHECK-NEXT: G_BRCOND [[ICMP16]](s1), %bb.17
; CHECK-NEXT: G_BR %bb.77
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.77.bb:
; CHECK-NEXT: [[ICMP17:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C17]]
; CHECK-NEXT: G_BRCOND [[ICMP17]](s1), %bb.18
; CHECK-NEXT: G_BR %bb.78
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.78.bb:
; CHECK-NEXT: [[ICMP18:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C18]]
; CHECK-NEXT: G_BRCOND [[ICMP18]](s1), %bb.19
; CHECK-NEXT: G_BR %bb.79
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.79.bb:
; CHECK-NEXT: [[ICMP19:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C19]]
; CHECK-NEXT: G_BRCOND [[ICMP19]](s1), %bb.20
; CHECK-NEXT: G_BR %bb.80
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.80.bb:
; CHECK-NEXT: [[ICMP20:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C20]]
; CHECK-NEXT: G_BRCOND [[ICMP20]](s1), %bb.21
; CHECK-NEXT: G_BR %bb.81
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.81.bb:
; CHECK-NEXT: [[ICMP21:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C21]]
; CHECK-NEXT: G_BRCOND [[ICMP21]](s1), %bb.22
; CHECK-NEXT: G_BR %bb.82
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.82.bb:
; CHECK-NEXT: [[ICMP22:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C22]]
; CHECK-NEXT: G_BRCOND [[ICMP22]](s1), %bb.23
; CHECK-NEXT: G_BR %bb.83
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.83.bb:
; CHECK-NEXT: [[ICMP23:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C23]]
; CHECK-NEXT: G_BRCOND [[ICMP23]](s1), %bb.24
; CHECK-NEXT: G_BR %bb.84
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.84.bb:
; CHECK-NEXT: [[ICMP24:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C24]]
; CHECK-NEXT: G_BRCOND [[ICMP24]](s1), %bb.25
; CHECK-NEXT: G_BR %bb.85
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.85.bb:
; CHECK-NEXT: [[ICMP25:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C25]]
; CHECK-NEXT: G_BRCOND [[ICMP25]](s1), %bb.26
; CHECK-NEXT: G_BR %bb.86
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.86.bb:
; CHECK-NEXT: [[ICMP26:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C26]]
; CHECK-NEXT: G_BRCOND [[ICMP26]](s1), %bb.27
; CHECK-NEXT: G_BR %bb.87
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.87.bb:
; CHECK-NEXT: [[ICMP27:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C27]]
; CHECK-NEXT: G_BRCOND [[ICMP27]](s1), %bb.28
; CHECK-NEXT: G_BR %bb.88
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.88.bb:
; CHECK-NEXT: [[ICMP28:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C28]]
; CHECK-NEXT: G_BRCOND [[ICMP28]](s1), %bb.29
; CHECK-NEXT: G_BR %bb.89
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.89.bb:
; CHECK-NEXT: [[ICMP29:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C29]]
; CHECK-NEXT: G_BRCOND [[ICMP29]](s1), %bb.30
; CHECK-NEXT: G_BR %bb.90
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.90.bb:
; CHECK-NEXT: [[ICMP30:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C30]]
; CHECK-NEXT: G_BRCOND [[ICMP30]](s1), %bb.31
; CHECK-NEXT: G_BR %bb.91
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.91.bb:
; CHECK-NEXT: [[ICMP31:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C31]]
; CHECK-NEXT: G_BRCOND [[ICMP31]](s1), %bb.32
; CHECK-NEXT: G_BR %bb.92
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.92.bb:
; CHECK-NEXT: [[ICMP32:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C32]]
; CHECK-NEXT: G_BRCOND [[ICMP32]](s1), %bb.33
; CHECK-NEXT: G_BR %bb.93
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.93.bb:
; CHECK-NEXT: [[ICMP33:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C33]]
; CHECK-NEXT: G_BRCOND [[ICMP33]](s1), %bb.34
; CHECK-NEXT: G_BR %bb.94
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.94.bb:
; CHECK-NEXT: [[ICMP34:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C34]]
; CHECK-NEXT: G_BRCOND [[ICMP34]](s1), %bb.35
; CHECK-NEXT: G_BR %bb.95
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.95.bb:
; CHECK-NEXT: [[ICMP35:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C35]]
; CHECK-NEXT: G_BRCOND [[ICMP35]](s1), %bb.36
; CHECK-NEXT: G_BR %bb.96
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.96.bb:
; CHECK-NEXT: [[ICMP36:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C36]]
; CHECK-NEXT: G_BRCOND [[ICMP36]](s1), %bb.37
; CHECK-NEXT: G_BR %bb.97
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.97.bb:
; CHECK-NEXT: [[ICMP37:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C37]]
; CHECK-NEXT: G_BRCOND [[ICMP37]](s1), %bb.38
; CHECK-NEXT: G_BR %bb.98
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.98.bb:
; CHECK-NEXT: [[ICMP38:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C38]]
; CHECK-NEXT: G_BRCOND [[ICMP38]](s1), %bb.39
; CHECK-NEXT: G_BR %bb.99
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.99.bb:
; CHECK-NEXT: [[ICMP39:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C39]]
; CHECK-NEXT: G_BRCOND [[ICMP39]](s1), %bb.40
; CHECK-NEXT: G_BR %bb.100
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.100.bb:
; CHECK-NEXT: [[ICMP40:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C40]]
; CHECK-NEXT: G_BRCOND [[ICMP40]](s1), %bb.41
; CHECK-NEXT: G_BR %bb.101
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.101.bb:
; CHECK-NEXT: [[ICMP41:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C41]]
; CHECK-NEXT: G_BRCOND [[ICMP41]](s1), %bb.42
; CHECK-NEXT: G_BR %bb.102
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.102.bb:
; CHECK-NEXT: [[ICMP42:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C42]]
; CHECK-NEXT: G_BRCOND [[ICMP42]](s1), %bb.43
; CHECK-NEXT: G_BR %bb.103
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.103.bb:
; CHECK-NEXT: [[ICMP43:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C43]]
; CHECK-NEXT: G_BRCOND [[ICMP43]](s1), %bb.44
; CHECK-NEXT: G_BR %bb.104
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.104.bb:
; CHECK-NEXT: [[ICMP44:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C44]]
; CHECK-NEXT: G_BRCOND [[ICMP44]](s1), %bb.45
; CHECK-NEXT: G_BR %bb.105
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.105.bb:
; CHECK-NEXT: [[ICMP45:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C45]]
; CHECK-NEXT: G_BRCOND [[ICMP45]](s1), %bb.46
; CHECK-NEXT: G_BR %bb.106
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.106.bb:
; CHECK-NEXT: [[ICMP46:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C46]]
; CHECK-NEXT: G_BRCOND [[ICMP46]](s1), %bb.47
; CHECK-NEXT: G_BR %bb.107
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.107.bb:
; CHECK-NEXT: [[ICMP47:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C47]]
; CHECK-NEXT: G_BRCOND [[ICMP47]](s1), %bb.48
; CHECK-NEXT: G_BR %bb.108
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.108.bb:
; CHECK-NEXT: [[ICMP48:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C48]]
; CHECK-NEXT: G_BRCOND [[ICMP48]](s1), %bb.49
; CHECK-NEXT: G_BR %bb.109
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.109.bb:
; CHECK-NEXT: [[ICMP49:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C49]]
; CHECK-NEXT: G_BRCOND [[ICMP49]](s1), %bb.50
; CHECK-NEXT: G_BR %bb.110
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.110.bb:
; CHECK-NEXT: [[ICMP50:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C50]]
; CHECK-NEXT: G_BRCOND [[ICMP50]](s1), %bb.51
; CHECK-NEXT: G_BR %bb.111
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.111.bb:
; CHECK-NEXT: [[ICMP51:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C51]]
; CHECK-NEXT: G_BRCOND [[ICMP51]](s1), %bb.52
; CHECK-NEXT: G_BR %bb.112
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.112.bb:
; CHECK-NEXT: [[ICMP52:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C52]]
; CHECK-NEXT: G_BRCOND [[ICMP52]](s1), %bb.53
; CHECK-NEXT: G_BR %bb.113
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.113.bb:
; CHECK-NEXT: [[ICMP53:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C53]]
; CHECK-NEXT: G_BRCOND [[ICMP53]](s1), %bb.54
; CHECK-NEXT: G_BR %bb.114
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.114.bb:
; CHECK-NEXT: [[ICMP54:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY1]](s32), [[C54]]
; CHECK-NEXT: G_BRCOND [[ICMP54]](s1), %bb.55
; CHECK-NEXT: G_BR %bb.60
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.bb3:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.bb4:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.bb5:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.bb6:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.6.bb7:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.7.bb8:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.8.bb9:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.9.bb10:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.10.bb11:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.11.bb12:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.12.bb13:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.13.bb14:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.14.bb15:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.15.bb16:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.16.bb17:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.17.bb18:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.18.bb19:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.19.bb20:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.20.bb21:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.21.bb22:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.22.bb23:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.23.bb24:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.24.bb25:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.25.bb26:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.26.bb27:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.27.bb28:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.28.bb29:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.29.bb30:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.30.bb31:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.31.bb32:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.32.bb33:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.33.bb34:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.34.bb35:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.35.bb36:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.36.bb37:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.37.bb38:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.38.bb39:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.39.bb40:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.40.bb41:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.41.bb42:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.42.bb43:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.43.bb44:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.44.bb45:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.45.bb46:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.46.bb47:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.47.bb48:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.48.bb49:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.49.bb50:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.50.bb51:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.51.bb52:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.52.bb53:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.53.bb54:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.54.bb55:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.55.bb56:
; CHECK-NEXT: G_BR %bb.56
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.56.bb57:
; CHECK-NEXT: [[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
; CHECK-NEXT: [[C111:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[PHI]], [[C111]]
; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[GV]], [[MUL]](s64)
; CHECK-NEXT: [[C112:%[0-9]+]]:_(s64) = G_CONSTANT i64 8
; CHECK-NEXT: %120:_(p0) = nuw nusw G_PTR_ADD [[PTR_ADD]], [[C112]](s64)
; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD %120(p0) :: (load (p0) from %ir.tmp59)
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
; CHECK-NEXT: $x1 = COPY [[LOAD]](p0)
; CHECK-NEXT: BL @wibble, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
; CHECK-NEXT: G_BR %bb.59
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.57.bb62:
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
; CHECK-NEXT: $x1 = COPY [[COPY2]](p0)
; CHECK-NEXT: BL @wibble, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
; CHECK-NEXT: G_BR %bb.59
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.58.bb64:
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: $w0 = COPY [[COPY1]](s32)
; CHECK-NEXT: $x1 = COPY [[FRAME_INDEX]](p0)
; CHECK-NEXT: BL @baz, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $x1
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
; CHECK-NEXT: $x1 = COPY [[FRAME_INDEX]](p0)
; CHECK-NEXT: BL @wibble, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
; CHECK-NEXT: G_BR %bb.59
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.59.bb68:
; CHECK-NEXT: RET_ReallyLR
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.60.bb69:
; CHECK-NEXT: [[ICMP55:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY2]](p0), [[C55]]
; CHECK-NEXT: G_BRCOND [[ICMP55]](s1), %bb.58
; CHECK-NEXT: G_BR %bb.57
bb:
%tmp = alloca [16 x i32], align 4
switch i32 %arg1, label %bb69 [
i32 3, label %bb57
i32 4, label %bb3
i32 6, label %bb4
i32 7, label %bb5
i32 8, label %bb6
i32 9, label %bb7
i32 10, label %bb8
i32 11, label %bb9
i32 12, label %bb10
i32 13, label %bb11
i32 14, label %bb12
i32 15, label %bb13
i32 16, label %bb14
i32 17, label %bb15
i32 18, label %bb16
i32 19, label %bb17
i32 20, label %bb18
i32 21, label %bb19
i32 22, label %bb20
i32 23, label %bb21
i32 24, label %bb22
i32 25, label %bb23
i32 26, label %bb24
i32 27, label %bb25
i32 28, label %bb26
i32 29, label %bb27
i32 30, label %bb28
i32 31, label %bb29
i32 32, label %bb30
i32 33, label %bb31
i32 34, label %bb32
i32 35, label %bb33
i32 36, label %bb34
i32 37, label %bb35
i32 38, label %bb36
i32 39, label %bb37
i32 41, label %bb38
i32 42, label %bb39
i32 43, label %bb40
i32 44, label %bb41
i32 45, label %bb42
i32 46, label %bb43
i32 47, label %bb44
i32 48, label %bb45
i32 49, label %bb46
i32 50, label %bb47
i32 51, label %bb48
i32 52, label %bb49
i32 53, label %bb50
i32 54, label %bb51
i32 55, label %bb52
i32 4352, label %bb53
i32 4353, label %bb54
i32 4354, label %bb55
i32 4355, label %bb56
]
bb3: ; preds = %bb
br label %bb57
bb4: ; preds = %bb
br label %bb57
bb5: ; preds = %bb
br label %bb57
bb6: ; preds = %bb
br label %bb57
bb7: ; preds = %bb
br label %bb57
bb8: ; preds = %bb
br label %bb57
bb9: ; preds = %bb
br label %bb57
bb10: ; preds = %bb
br label %bb57
bb11: ; preds = %bb
br label %bb57
bb12: ; preds = %bb
br label %bb57
bb13: ; preds = %bb
br label %bb57
bb14: ; preds = %bb
br label %bb57
bb15: ; preds = %bb
br label %bb57
bb16: ; preds = %bb
br label %bb57
bb17: ; preds = %bb
br label %bb57
bb18: ; preds = %bb
br label %bb57
bb19: ; preds = %bb
br label %bb57
bb20: ; preds = %bb
br label %bb57
bb21: ; preds = %bb
br label %bb57
bb22: ; preds = %bb
br label %bb57
bb23: ; preds = %bb
br label %bb57
bb24: ; preds = %bb
br label %bb57
bb25: ; preds = %bb
br label %bb57
bb26: ; preds = %bb
br label %bb57
bb27: ; preds = %bb
br label %bb57
bb28: ; preds = %bb
br label %bb57
bb29: ; preds = %bb
br label %bb57
bb30: ; preds = %bb
br label %bb57
bb31: ; preds = %bb
br label %bb57
bb32: ; preds = %bb
br label %bb57
bb33: ; preds = %bb
br label %bb57
bb34: ; preds = %bb
br label %bb57
bb35: ; preds = %bb
br label %bb57
bb36: ; preds = %bb
br label %bb57
bb37: ; preds = %bb
br label %bb57
bb38: ; preds = %bb
br label %bb57
bb39: ; preds = %bb
br label %bb57
bb40: ; preds = %bb
br label %bb57
bb41: ; preds = %bb
br label %bb57
bb42: ; preds = %bb
br label %bb57
bb43: ; preds = %bb
br label %bb57
bb44: ; preds = %bb
br label %bb57
bb45: ; preds = %bb
br label %bb57
bb46: ; preds = %bb
br label %bb57
bb47: ; preds = %bb
br label %bb57
bb48: ; preds = %bb
br label %bb57
bb49: ; preds = %bb
br label %bb57
bb50: ; preds = %bb
br label %bb57
bb51: ; preds = %bb
br label %bb57
bb52: ; preds = %bb
br label %bb57
bb53: ; preds = %bb
br label %bb57
bb54: ; preds = %bb
br label %bb57
bb55: ; preds = %bb
br label %bb57
bb56: ; preds = %bb
br label %bb57
bb57: ; 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
%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 ]
%tmp59 = getelementptr inbounds [55 x %0], ptr @global, i64 0, i64 %tmp58, i32 1
%tmp60 = load ptr, ptr %tmp59, align 8
%tmp61 = call ptr @wibble(ptr %arg, ptr %tmp60)
br label %bb68
bb62: ; preds = %bb69
%tmp63 = call ptr @wibble(ptr %arg, ptr nonnull %arg2)
br label %bb68
bb64: ; preds = %bb69
call void @baz(i32 %arg1, ptr %tmp)
%tmp67 = call ptr @wibble(ptr %arg, ptr %tmp)
br label %bb68
bb68: ; preds = %bb64, %bb62, %bb57
ret void
bb69: ; preds = %bb
%tmp70 = icmp eq ptr %arg2, null
br i1 %tmp70, label %bb64, label %bb62
}
declare ptr @wibble(ptr returned, ptr)
declare void @baz(i32, ptr)
; Check that with 2 jump tables, the phi node doesn't lose the edge from the
; second one.
define void @jt_2_tables_phi_edge_from_second() {
; CHECK-LABEL: name: jt_2_tables_phi_edge_from_second
; CHECK: bb.1.entry:
; CHECK-NEXT: [[DEF:%[0-9]+]]:_(p0) = G_IMPLICIT_DEF
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 123
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 263
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 265
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 270
; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 279
; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 37
; CHECK-NEXT: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 43
; CHECK-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 45
; CHECK-NEXT: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 60
; CHECK-NEXT: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 278
; CHECK-NEXT: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 280
; CHECK-NEXT: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 281
; CHECK-NEXT: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 283
; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(s1) = G_IMPLICIT_DEF
; CHECK-NEXT: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
; CHECK-NEXT: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
; CHECK-NEXT: [[C15:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
; CHECK-NEXT: [[C16:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
; CHECK-NEXT: [[C17:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
; CHECK-NEXT: [[C18:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
; CHECK-NEXT: [[C19:%[0-9]+]]:_(s32) = G_CONSTANT i32 9
; CHECK-NEXT: [[C20:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
; CHECK-NEXT: [[C21:%[0-9]+]]:_(s32) = G_CONSTANT i32 15
; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[DEF]](p0) :: (load (s32) from `ptr undef`, align 8)
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.6
; CHECK-NEXT: G_BR %bb.19
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.19.entry:
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C1]]
; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.4
; CHECK-NEXT: G_BR %bb.20
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.20.entry:
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C2]]
; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.7
; CHECK-NEXT: G_BR %bb.21
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.21.entry:
; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C3]]
; CHECK-NEXT: G_BRCOND [[ICMP3]](s1), %bb.2
; CHECK-NEXT: G_BR %bb.22
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.22.entry:
; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[LOAD]](s32), [[C4]]
; CHECK-NEXT: G_BRCOND [[ICMP4]](s1), %bb.5
; CHECK-NEXT: G_BR %bb.23
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.23.entry:
; CHECK-NEXT: G_BR %bb.3
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.if.then:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.sw.bb2.i41:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.sw.bb7.i44:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.sw.bb8.i45:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.6.sw.bb13.i47:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.7.sw.bb14.i48:
; CHECK-NEXT: [[ICMP5:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C5]]
; CHECK-NEXT: G_BRCOND [[ICMP5]](s1), %bb.10
; CHECK-NEXT: G_BR %bb.24
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.24.sw.bb14.i48:
; CHECK-NEXT: [[ICMP6:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C6]]
; CHECK-NEXT: G_BRCOND [[ICMP6]](s1), %bb.16
; CHECK-NEXT: G_BR %bb.25
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.25.sw.bb14.i48:
; CHECK-NEXT: [[ICMP7:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C7]]
; CHECK-NEXT: G_BRCOND [[ICMP7]](s1), %bb.9
; CHECK-NEXT: G_BR %bb.26
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.26.sw.bb14.i48:
; CHECK-NEXT: [[ICMP8:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C8]]
; CHECK-NEXT: G_BRCOND [[ICMP8]](s1), %bb.14
; CHECK-NEXT: G_BR %bb.27
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.27.sw.bb14.i48:
; CHECK-NEXT: [[ICMP9:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C9]]
; CHECK-NEXT: G_BRCOND [[ICMP9]](s1), %bb.11
; CHECK-NEXT: G_BR %bb.28
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.28.sw.bb14.i48:
; CHECK-NEXT: [[ICMP10:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C10]]
; CHECK-NEXT: G_BRCOND [[ICMP10]](s1), %bb.13
; CHECK-NEXT: G_BR %bb.29
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.29.sw.bb14.i48:
; CHECK-NEXT: [[ICMP11:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C11]]
; CHECK-NEXT: G_BRCOND [[ICMP11]](s1), %bb.15
; CHECK-NEXT: G_BR %bb.30
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.30.sw.bb14.i48:
; CHECK-NEXT: [[ICMP12:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF1]](s32), [[C12]]
; CHECK-NEXT: G_BRCOND [[ICMP12]](s1), %bb.12
; CHECK-NEXT: G_BR %bb.18
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.8.sw.default.i49:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.9.sw.bb1.i:
; CHECK-NEXT: G_BR %bb.16
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.10.sw.bb4.i:
; CHECK-NEXT: G_BR %bb.16
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.11.sw.bb6.i:
; CHECK-NEXT: G_BR %bb.16
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.12.sw.bb7.i:
; CHECK-NEXT: G_BR %bb.16
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.13.sw.bb8.i:
; CHECK-NEXT: G_BR %bb.16
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.14.sw.bb9.i:
; CHECK-NEXT: G_BR %bb.16
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.15.sw.bb12.i:
; CHECK-NEXT: G_BR %bb.16
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.16.land.rhs.lr.ph:
; CHECK-NEXT: [[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
; CHECK-NEXT: G_BRCOND [[DEF2]](s1), %bb.17
; CHECK-NEXT: G_BR %bb.18
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.17.while.body:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: BL @jt_2_tables_phi_edge_from_second, csr_aarch64_aapcs, implicit-def $lr, implicit $sp
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.18.while.end:
; CHECK-NEXT: [[PHI1:%[0-9]+]]:_(s32) = G_PHI [[C21]](s32), %bb.30, [[PHI]](s32), %bb.16
; CHECK-NEXT: RET_ReallyLR
entry:
%0 = load i32, ptr undef, align 8
switch i32 %0, label %sw.default.i49 [
i32 270, label %if.then
i32 265, label %sw.bb14.i48
i32 123, label %sw.bb13.i47
i32 279, label %sw.bb8.i45
i32 286, label %sw.bb2.i41
i32 263, label %sw.bb7.i44
]
if.then: ; preds = %entry
unreachable
sw.bb2.i41: ; preds = %entry
unreachable
sw.bb7.i44: ; preds = %entry
unreachable
sw.bb8.i45: ; preds = %entry
unreachable
sw.bb13.i47: ; preds = %entry
unreachable
sw.bb14.i48: ; preds = %entry
switch i32 undef, label %while.end [
i32 43, label %land.rhs.lr.ph
i32 45, label %sw.bb1.i
i32 280, label %sw.bb8.i
i32 60, label %sw.bb9.i
i32 37, label %sw.bb4.i
i32 281, label %sw.bb12.i
i32 278, label %sw.bb6.i
i32 283, label %sw.bb7.i
]
sw.default.i49: ; preds = %entry
unreachable
sw.bb1.i: ; preds = %sw.bb14.i48
br label %land.rhs.lr.ph
sw.bb4.i: ; preds = %sw.bb14.i48
br label %land.rhs.lr.ph
sw.bb6.i: ; preds = %sw.bb14.i48
br label %land.rhs.lr.ph
sw.bb7.i: ; preds = %sw.bb14.i48
br label %land.rhs.lr.ph
sw.bb8.i: ; preds = %sw.bb14.i48
br label %land.rhs.lr.ph
sw.bb9.i: ; preds = %sw.bb14.i48
br label %land.rhs.lr.ph
sw.bb12.i: ; preds = %sw.bb14.i48
br label %land.rhs.lr.ph
land.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
%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 ]
br i1 undef, label %while.body, label %while.end
while.body: ; preds = %land.rhs.lr.ph
call void @jt_2_tables_phi_edge_from_second()
unreachable
while.end: ; preds = %land.rhs.lr.ph, %sw.bb14.i48
%op.0.lcssa = phi i32 [ 15, %sw.bb14.i48 ], [ %retval.0.i.ph, %land.rhs.lr.ph ]
ret void
}
define i32 @range_test(i32 %x) {
; CHECK-LABEL: name: range_test
; CHECK: bb.1.entry:
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[C]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.entry:
; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[C1]]
; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(ule), [[SUB]](s32), [[C5]]
; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.2
; CHECK-NEXT: G_BR %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.sw.bb:
; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = nsw G_ADD [[COPY]], [[C3]]
; CHECK-NEXT: G_BR %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.sw.bb1:
; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = nsw G_MUL [[COPY]], [[C2]]
; CHECK-NEXT: G_BR %bb.4
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.return:
; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[MUL]](s32), %bb.3, [[ADD]](s32), %bb.2, [[C4]](s32), %bb.5
; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
entry:
switch i32 %x, label %return [
i32 24, label %sw.bb
i32 25, label %sw.bb
i32 26, label %sw.bb
i32 6, label %sw.bb1
]
sw.bb:
%add = add nsw i32 %x, 42
br label %return
sw.bb1:
%mul = mul nsw i32 %x, 3
br label %return
return:
%retval.0 = phi i32 [ %mul, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ]
ret i32 %retval.0
}
define ptr @test_range_phi_switch_cycle() {
; CHECK-LABEL: name: test_range_phi_switch_cycle
; CHECK: bb.1.bb:
; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 305
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 307
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 497
; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
; CHECK-NEXT: G_BR %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.bb1:
; CHECK-NEXT: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[DEF]](s32), %bb.1, [[C3]](s32), %bb.3, [[C4]](s32), %bb.4, [[C5]](s32), %bb.2
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.2
; CHECK-NEXT: G_BR %bb.6
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.6.bb1:
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C1]]
; CHECK-NEXT: G_BRCOND [[ICMP1]](s1), %bb.3
; CHECK-NEXT: G_BR %bb.7
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.7.bb1:
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[DEF]](s32), [[C2]]
; CHECK-NEXT: G_BRCOND [[ICMP2]](s1), %bb.4
; CHECK-NEXT: G_BR %bb.5
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.bb2:
; CHECK-NEXT: G_BR %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.4.bb3:
; CHECK-NEXT: G_BR %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.5.bb4:
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: $w0 = COPY [[PHI]](s32)
; CHECK-NEXT: BL @ham, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit-def $x0
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
bb:
br label %bb1
bb1: ; preds = %bb3, %bb2, %bb1, %bb
%tmp = phi i32 [undef, %bb ], [ 4, %bb2 ], [ 3, %bb3 ], [ 1, %bb1]
switch i32 undef, label %bb4 [
i32 305, label %bb1
i32 497, label %bb3
i32 307, label %bb2
]
bb2: ; preds = %bb1
br label %bb1
bb3: ; preds = %bb1
br label %bb1
bb4: ; preds = %bb1
%tmp5 = tail call ptr @ham(i32 %tmp)
unreachable
}
declare ptr @ham(i32)
define internal void @bar() unnamed_addr #1 {
; CHECK-LABEL: name: bar
; CHECK: bb.1 (%ir-block.0):
unreachable
}
define i1 @i1_value_cmp_is_signed(i1) {
; CHECK-LABEL: name: i1_value_cmp_is_signed
; CHECK: bb.1.Entry:
; CHECK-NEXT: liveins: $w0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32)
; CHECK-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s8) = G_ASSERT_ZEXT [[TRUNC]], 1
; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s1) = G_TRUNC [[ASSERT_ZEXT]](s8)
; CHECK-NEXT: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 true
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s1) = G_CONSTANT i1 false
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(sle), [[TRUNC1]](s1), [[C1]]
; CHECK-NEXT: G_BRCOND [[ICMP]](s1), %bb.3
; CHECK-NEXT: G_BR %bb.2
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.2.BadValue:
; CHECK-NEXT: successors:
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: BL @bar, csr_aarch64_aapcs, implicit-def $lr, implicit $sp
; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: bb.3.OkValue:
; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s8) = G_ZEXT [[TRUNC1]](s1)
; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ZEXT]](s8)
; CHECK-NEXT: $w0 = COPY [[ANYEXT]](s32)
; CHECK-NEXT: RET_ReallyLR implicit $w0
Entry:
switch i1 %0, label %BadValue [
i1 false, label %OkValue
i1 true, label %OkValue
]
BadValue:
call fastcc void @bar()
unreachable
OkValue:
ret i1 %0
}