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)
29 ; CHECK: [[VREGC:%[0-9]+]]:gprnopc = COPY [[VREGY]]
31 %3(s32) = G_SELECT %2(s1), %0, %1
32 ; CHECK: t2CMPri [[VREGC]], 0, 14, $noreg, implicit-def $cpsr
33 ; CHECK: [[RES:%[0-9]+]]:rgpr = t2MOVCCr [[VREGX]], [[VREGY]], 0, $cpsr
36 ; CHECK: $r0 = COPY [[RES]]
38 BX_RET 14, $noreg, implicit $r0
39 ; CHECK: BX_RET 14, $noreg, implicit $r0
43 # CHECK-LABEL: name: test_select_ptr
47 # CHECK: selected: true
49 - { id: 0, class: gprb }
50 - { id: 1, class: gprb }
51 - { id: 2, class: gprb }
52 - { id: 3, class: gprb }
53 - { id: 4, class: gprb }
56 liveins: $r0, $r1, $r2
59 ; CHECK: [[VREGX:%[0-9]+]]:rgpr = COPY $r0
62 ; CHECK: [[VREGY:%[0-9]+]]:rgpr = COPY $r1
65 ; CHECK: [[VREGC32:%[0-9]+]]:gpr = COPY $r2
67 %3(s1) = G_TRUNC %2(s32)
68 ; CHECK: [[VREGC:%[0-9]+]]:gprnopc = COPY [[VREGC32]]
70 %4(p0) = G_SELECT %3(s1), %0, %1
71 ; CHECK: t2CMPri [[VREGC]], 0, 14, $noreg, implicit-def $cpsr
72 ; CHECK: [[RES:%[0-9]+]]:rgpr = t2MOVCCr [[VREGX]], [[VREGY]], 0, $cpsr
75 ; CHECK: $r0 = COPY [[RES]]
77 BX_RET 14, $noreg, implicit $r0
78 ; CHECK: BX_RET 14, $noreg, implicit $r0