1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 define void @test_select_s32() { ret void }
5 define void @test_select_ptr() { ret void }
13 - { id: 0, class: gprb }
14 - { id: 1, class: gprb }
15 - { id: 2, class: gprb }
16 - { id: 3, class: gprb }
21 ; CHECK-LABEL: name: test_select_s32
22 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
23 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
24 ; CHECK: t2TSTri [[COPY1]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
25 ; CHECK: [[t2MOVCCr:%[0-9]+]]:rgpr = t2MOVCCr [[COPY]], [[COPY1]], 0 /* CC::eq */, $cpsr
26 ; CHECK: $r0 = COPY [[t2MOVCCr]]
27 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
32 %2(s1) = G_TRUNC %1(s32)
34 %3(s32) = G_SELECT %2(s1), %0, %1
38 BX_RET 14, $noreg, implicit $r0
46 - { id: 0, class: gprb }
47 - { id: 1, class: gprb }
48 - { id: 2, class: gprb }
49 - { id: 3, class: gprb }
50 - { id: 4, class: gprb }
53 liveins: $r0, $r1, $r2
55 ; CHECK-LABEL: name: test_select_ptr
56 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
57 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
58 ; CHECK: [[COPY2:%[0-9]+]]:gpr = COPY $r2
59 ; CHECK: [[COPY3:%[0-9]+]]:rgpr = COPY [[COPY2]]
60 ; CHECK: t2TSTri [[COPY3]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
61 ; CHECK: [[t2MOVCCr:%[0-9]+]]:rgpr = t2MOVCCr [[COPY]], [[COPY1]], 0 /* CC::eq */, $cpsr
62 ; CHECK: $r0 = COPY [[t2MOVCCr]]
63 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
70 %3(s1) = G_TRUNC %2(s32)
72 %4(p0) = G_SELECT %3(s1), %0, %1
76 BX_RET 14, $noreg, implicit $r0