1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer -o - %s | FileCheck %s -check-prefixes=GCN,SI
3 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -o - %s | FileCheck %s -check-prefixes=GCN,VI
5 name: test_sextload_flat_i32_i8
10 ; SI-LABEL: name: test_sextload_flat_i32_i8
11 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
12 ; SI: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 1)
13 ; SI: $vgpr0 = COPY [[SEXTLOAD]](s32)
14 ; VI-LABEL: name: test_sextload_flat_i32_i8
15 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
16 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 1)
17 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LOAD]](s32)
18 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
19 ; VI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
20 ; VI: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
21 ; VI: $vgpr0 = COPY [[ASHR]](s32)
22 %0:_(p0) = COPY $vgpr0_vgpr1
23 %1:_(s32) = G_SEXTLOAD %0 :: (load 1, addrspace 0)
27 name: test_sextload_flat_i32_i16
32 ; SI-LABEL: name: test_sextload_flat_i32_i16
33 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
34 ; SI: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 2)
35 ; SI: $vgpr0 = COPY [[SEXTLOAD]](s32)
36 ; VI-LABEL: name: test_sextload_flat_i32_i16
37 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
38 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 2)
39 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LOAD]](s32)
40 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
41 ; VI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
42 ; VI: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
43 ; VI: $vgpr0 = COPY [[ASHR]](s32)
44 %0:_(p0) = COPY $vgpr0_vgpr1
45 %1:_(s32) = G_SEXTLOAD %0 :: (load 2, addrspace 0)
49 name: test_sextload_flat_i31_i8
54 ; SI-LABEL: name: test_sextload_flat_i31_i8
55 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
56 ; SI: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 1)
57 ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SEXTLOAD]](s32)
58 ; SI: $vgpr0 = COPY [[COPY1]](s32)
59 ; VI-LABEL: name: test_sextload_flat_i31_i8
60 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
61 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 1)
62 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LOAD]](s32)
63 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
64 ; VI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
65 ; VI: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
66 ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[ASHR]](s32)
67 ; VI: $vgpr0 = COPY [[COPY2]](s32)
68 %0:_(p0) = COPY $vgpr0_vgpr1
69 %1:_(s31) = G_SEXTLOAD %0 :: (load 1, addrspace 0)
70 %2:_(s32) = G_ANYEXT %1
74 name: test_sextload_flat_i64_i8
79 ; SI-LABEL: name: test_sextload_flat_i64_i8
80 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
81 ; SI: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 1)
82 ; SI: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
83 ; SI: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
84 ; VI-LABEL: name: test_sextload_flat_i64_i8
85 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
86 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 1)
87 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LOAD]](s32)
88 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
89 ; VI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
90 ; VI: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
91 ; VI: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[ASHR]](s32)
92 ; VI: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
93 %0:_(p0) = COPY $vgpr0_vgpr1
94 %1:_(s64) = G_SEXTLOAD %0 :: (load 1, addrspace 0)
95 $vgpr0_vgpr1 = COPY %1
98 name: test_sextload_flat_i64_i16
101 liveins: $vgpr0_vgpr1
103 ; SI-LABEL: name: test_sextload_flat_i64_i16
104 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
105 ; SI: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 2)
106 ; SI: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
107 ; SI: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
108 ; VI-LABEL: name: test_sextload_flat_i64_i16
109 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
110 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 2)
111 ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LOAD]](s32)
112 ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
113 ; VI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
114 ; VI: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
115 ; VI: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[ASHR]](s32)
116 ; VI: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
117 %0:_(p0) = COPY $vgpr0_vgpr1
118 %1:_(s64) = G_SEXTLOAD %0 :: (load 2, addrspace 0)
119 $vgpr0_vgpr1 = COPY %1
122 name: test_sextload_flat_i64_i32
125 liveins: $vgpr0_vgpr1
127 ; SI-LABEL: name: test_sextload_flat_i64_i32
128 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
129 ; SI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 4)
130 ; SI: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
131 ; SI: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
132 ; VI-LABEL: name: test_sextload_flat_i64_i32
133 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
134 ; VI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 4)
135 ; VI: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
136 ; VI: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
137 %0:_(p0) = COPY $vgpr0_vgpr1
138 %1:_(s64) = G_SEXTLOAD %0 :: (load 4, addrspace 0)
139 $vgpr0_vgpr1 = COPY %1