1 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3 define void @test_select_s32() { ret void }
4 define void @test_select_ptr() { ret void }
8 # CHECK-LABEL: name: test_select_s32
12 # CHECK: selected: true
14 - { id: 0, class: gprb }
15 - { id: 1, class: gprb }
16 - { id: 2, class: gprb }
17 - { id: 3, class: gprb }
23 ; CHECK: [[VREGX:%[0-9]+]]:rgpr = COPY $r0
26 ; CHECK: [[VREGY:%[0-9]+]]:rgpr = COPY $r1
28 %2(s1) = G_TRUNC %1(s32)
30 %3(s32) = G_SELECT %2(s1), %0, %1
31 ; CHECK: t2TSTri [[VREGY]], 1, 14, $noreg, implicit-def $cpsr
32 ; CHECK: [[RES:%[0-9]+]]:rgpr = t2MOVCCr [[VREGX]], [[VREGY]], 0, $cpsr
35 ; CHECK: $r0 = COPY [[RES]]
37 BX_RET 14, $noreg, implicit $r0
38 ; CHECK: BX_RET 14, $noreg, implicit $r0
42 # CHECK-LABEL: name: test_select_ptr
46 # CHECK: selected: true
48 - { id: 0, class: gprb }
49 - { id: 1, class: gprb }
50 - { id: 2, class: gprb }
51 - { id: 3, class: gprb }
52 - { id: 4, class: gprb }
55 liveins: $r0, $r1, $r2
58 ; CHECK: [[VREGX:%[0-9]+]]:rgpr = COPY $r0
61 ; CHECK: [[VREGY:%[0-9]+]]:rgpr = COPY $r1
64 ; CHECK: [[VREGC32:%[0-9]+]]:gpr = COPY $r2
66 %3(s1) = G_TRUNC %2(s32)
67 ; CHECK: [[VREGC:%[0-9]+]]:rgpr = COPY [[VREGC32]]
69 %4(p0) = G_SELECT %3(s1), %0, %1
70 ; CHECK: t2TSTri [[VREGC]], 1, 14, $noreg, implicit-def $cpsr
71 ; CHECK: [[RES:%[0-9]+]]:rgpr = t2MOVCCr [[VREGX]], [[VREGY]], 0, $cpsr
74 ; CHECK: $r0 = COPY [[RES]]
76 BX_RET 14, $noreg, implicit $r0
77 ; CHECK: BX_RET 14, $noreg, implicit $r0