1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -march=amdgcn -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3# RUN: llc -march=amdgcn -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
4
5---
6name: gep_p1_s_k
7legalized: true
8
9body: |
10  bb.0:
11    liveins: $sgpr0_sgpr1
12
13    ; CHECK-LABEL: name: gep_p1_s_k
14    ; CHECK: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
15    ; CHECK: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 1
16    ; CHECK: [[GEP:%[0-9]+]]:sgpr(p1) = G_PTR_ADD [[COPY]], [[C]](s64)
17    %0:_(p1) = COPY $sgpr0_sgpr1
18    %1:_(s64) = G_CONSTANT i64 1
19    %2:_(p1) = G_PTR_ADD %0, %1
20...
21
22---
23name: gep_p1_s_s
24legalized: true
25
26body: |
27  bb.0:
28    liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
29
30    ; CHECK-LABEL: name: gep_p1_s_s
31    ; CHECK: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
32    ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s64) = COPY $sgpr2_sgpr3
33    ; CHECK: [[GEP:%[0-9]+]]:sgpr(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
34    %0:_(p1) = COPY $sgpr0_sgpr1
35    %1:_(s64) = COPY $sgpr2_sgpr3
36    %2:_(p1) = G_PTR_ADD %0, %1
37...
38
39---
40name: gep_p1_v_k
41legalized: true
42
43body: |
44  bb.0:
45    liveins: $vgpr0_vgpr1
46
47    ; CHECK-LABEL: name: gep_p1_v_k
48    ; CHECK: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
49    ; CHECK: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 1
50    ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s64) = COPY [[C]](s64)
51    ; CHECK: [[GEP:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
52    %0:_(p1) = COPY $vgpr0_vgpr1
53    %1:_(s64) = G_CONSTANT i64 1
54    %2:_(p1) = G_PTR_ADD %0, %1
55...
56
57---
58name: gep_p1_v_s
59legalized: true
60
61body: |
62  bb.0:
63    liveins: $vgpr0_vgpr1, $sgpr0_sgpr1
64
65    ; CHECK-LABEL: name: gep_p1_v_s
66    ; CHECK: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
67    ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
68    ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s64) = COPY [[COPY1]](s64)
69    ; CHECK: [[GEP:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[COPY2]](s64)
70    %0:_(p1) = COPY $vgpr0_vgpr1
71    %1:_(s64) = COPY $sgpr0_sgpr1
72    %2:_(p1) = G_PTR_ADD %0, %1
73...
74
75---
76name: gep_p1_v_v
77legalized: true
78
79body: |
80  bb.0:
81    liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
82
83    ; CHECK-LABEL: name: gep_p1_v_v
84    ; CHECK: [[COPY:%[0-9]+]]:vgpr(p1) = COPY $vgpr0_vgpr1
85    ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s64) = COPY $vgpr2_vgpr3
86    ; CHECK: [[GEP:%[0-9]+]]:vgpr(p1) = G_PTR_ADD [[COPY]], [[COPY1]](s64)
87    %0:_(p1) = COPY $vgpr0_vgpr1
88    %1:_(s64) = COPY $vgpr2_vgpr3
89    %2:_(p1) = G_PTR_ADD %0, %1
90...
91