1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
10 liveins: $sgpr0, $sgpr1
11 ; CHECK-LABEL: name: add_s16_ss
12 ; CHECK: liveins: $sgpr0, $sgpr1
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
15 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
16 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
17 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
18 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s16)
19 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC1]](s16)
20 ; CHECK-NEXT: [[ADD:%[0-9]+]]:sgpr(s32) = G_ADD [[ANYEXT]], [[ANYEXT1]]
21 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[ADD]](s32)
22 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC2]](s16)
23 %0:_(s32) = COPY $sgpr0
24 %1:_(s32) = COPY $sgpr1
25 %2:_(s16) = G_TRUNC %0
26 %3:_(s16) = G_TRUNC %1
27 %4:_(s16) = G_ADD %2, %3
28 S_ENDPGM 0, implicit %4
37 liveins: $sgpr0, $vgpr0
38 ; CHECK-LABEL: name: add_s16_sv
39 ; CHECK: liveins: $sgpr0, $vgpr0
41 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
42 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
43 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
44 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
45 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC]](s16)
46 ; CHECK-NEXT: [[ADD:%[0-9]+]]:vgpr(s16) = G_ADD [[COPY2]], [[TRUNC1]]
47 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ADD]](s16)
48 %0:_(s32) = COPY $sgpr0
49 %1:_(s32) = COPY $vgpr0
50 %2:_(s16) = G_TRUNC %0
51 %3:_(s16) = G_TRUNC %1
52 %4:_(s16) = G_ADD %2, %3
53 S_ENDPGM 0, implicit %4
62 liveins: $sgpr0, $vgpr0
63 ; CHECK-LABEL: name: add_s16_vs
64 ; CHECK: liveins: $sgpr0, $vgpr0
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
67 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
68 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
69 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
70 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC1]](s16)
71 ; CHECK-NEXT: [[ADD:%[0-9]+]]:vgpr(s16) = G_ADD [[TRUNC]], [[COPY2]]
72 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ADD]](s16)
73 %0:_(s32) = COPY $vgpr0
74 %1:_(s32) = COPY $sgpr0
75 %2:_(s16) = G_TRUNC %0
76 %3:_(s16) = G_TRUNC %1
77 %4:_(s16) = G_ADD %2, %3
78 S_ENDPGM 0, implicit %4
87 liveins: $vgpr0, $vgpr1
88 ; CHECK-LABEL: name: add_s16_vv
89 ; CHECK: liveins: $vgpr0, $vgpr1
91 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
92 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
93 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
94 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
95 ; CHECK-NEXT: [[ADD:%[0-9]+]]:vgpr(s16) = G_ADD [[TRUNC]], [[TRUNC1]]
96 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ADD]](s16)
97 %0:_(s32) = COPY $vgpr0
98 %1:_(s32) = COPY $vgpr1
99 %2:_(s16) = G_TRUNC %0
100 %3:_(s16) = G_TRUNC %1
101 %4:_(s16) = G_ADD %2, %3
102 S_ENDPGM 0, implicit %4