1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx908 -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx908 -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
6 name: merge_s64_s32_s32_ss
11 liveins: $sgpr0, $sgpr1
12 ; CHECK-LABEL: name: merge_s64_s32_s32_ss
13 ; CHECK: liveins: $sgpr0, $sgpr1
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
16 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:sgpr(s32) = G_EXTRACT [[COPY]](s64), 0
17 ; CHECK-NEXT: [[EXTRACT1:%[0-9]+]]:sgpr(s32) = G_EXTRACT [[COPY]](s64), 32
18 ; CHECK-NEXT: [[MV:%[0-9]+]]:sgpr(s64) = G_MERGE_VALUES [[EXTRACT]](s32), [[EXTRACT1]](s32)
19 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s64)
20 %0:_(s64) = COPY $sgpr0_sgpr1
21 %1:_(s32) = G_EXTRACT %0, 0
22 %2:_(s32) = G_EXTRACT %0, 32
23 %3:_(s64) = G_MERGE_VALUES %1, %2
24 S_ENDPGM 0, implicit %3
28 name: merge_s64_s32_s32_s64
33 liveins: $vgpr0, $vgpr1
34 ; CHECK-LABEL: name: merge_s64_s32_s32_s64
35 ; CHECK: liveins: $vgpr0, $vgpr1
37 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
38 ; CHECK-NEXT: [[EXTRACT:%[0-9]+]]:vgpr(s32) = G_EXTRACT [[COPY]](s64), 0
39 ; CHECK-NEXT: [[EXTRACT1:%[0-9]+]]:vgpr(s32) = G_EXTRACT [[COPY]](s64), 32
40 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[EXTRACT]](s32), [[EXTRACT1]](s32)
41 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s64)
42 %0:_(s64) = COPY $vgpr0_vgpr1
43 %1:_(s32) = G_EXTRACT %0, 0
44 %2:_(s32) = G_EXTRACT %0, 32
45 %3:_(s64) = G_MERGE_VALUES %1, %2
46 S_ENDPGM 0, implicit %3
50 name: merge_s64_s32_s32_aa
55 liveins: $agpr0, $agpr1
56 ; CHECK-LABEL: name: merge_s64_s32_s32_aa
57 ; CHECK: liveins: $agpr0, $agpr1
59 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
60 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr1
61 ; CHECK-NEXT: [[MV:%[0-9]+]]:agpr(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
62 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s64)
63 %0:_(s32) = COPY $agpr0
64 %1:_(s32) = COPY $agpr1
65 %2:_(s64) = G_MERGE_VALUES %0, %1
66 S_ENDPGM 0, implicit %2
70 name: merge_s64_s32_s32_sa
75 liveins: $sgpr0, $agpr0
76 ; CHECK-LABEL: name: merge_s64_s32_s32_sa
77 ; CHECK: liveins: $sgpr0, $agpr0
79 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
80 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:agpr(s32) = COPY $agpr0
81 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
82 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
83 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY2]](s32), [[COPY3]](s32)
84 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s64)
85 %0:_(s32) = COPY $sgpr0
86 %1:_(s32) = COPY $agpr0
87 %2:_(s64) = G_MERGE_VALUES %0, %1
88 S_ENDPGM 0, implicit %2
92 name: merge_s64_s32_s32_as
97 liveins: $sgpr0, $agpr0
98 ; CHECK-LABEL: name: merge_s64_s32_s32_as
99 ; CHECK: liveins: $sgpr0, $agpr0
101 ; CHECK-NEXT: [[COPY:%[0-9]+]]:agpr(s32) = COPY $agpr0
102 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
103 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
104 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
105 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY2]](s32), [[COPY3]](s32)
106 ; CHECK-NEXT: S_ENDPGM 0, implicit [[MV]](s64)
107 %0:_(s32) = COPY $agpr0
108 %1:_(s32) = COPY $sgpr0
109 %2:_(s64) = G_MERGE_VALUES %0, %1
110 S_ENDPGM 0, implicit %2