1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -o - %s | FileCheck %s -check-prefix=SI
3 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer -o - %s | FileCheck %s -check-prefix=VI
5 name: test_sextload_flat_i32_i8
10 ; SI-LABEL: name: test_sextload_flat_i32_i8
11 ; SI: liveins: $vgpr0_vgpr1
13 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
14 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
15 ; SI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
16 ; VI-LABEL: name: test_sextload_flat_i32_i8
17 ; VI: liveins: $vgpr0_vgpr1
19 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
20 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
21 ; VI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
22 %0:_(p0) = COPY $vgpr0_vgpr1
23 %1:_(s32) = G_SEXTLOAD %0 :: (load (s8), addrspace 0)
27 name: test_sextload_flat_i32_i16
32 ; SI-LABEL: name: test_sextload_flat_i32_i16
33 ; SI: liveins: $vgpr0_vgpr1
35 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
36 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
37 ; SI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
38 ; VI-LABEL: name: test_sextload_flat_i32_i16
39 ; VI: liveins: $vgpr0_vgpr1
41 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
42 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
43 ; VI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
44 %0:_(p0) = COPY $vgpr0_vgpr1
45 %1:_(s32) = G_SEXTLOAD %0 :: (load (s16), addrspace 0)
49 name: test_sextload_flat_i31_i8
54 ; SI-LABEL: name: test_sextload_flat_i31_i8
55 ; SI: liveins: $vgpr0_vgpr1
57 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
58 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
59 ; SI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
60 ; VI-LABEL: name: test_sextload_flat_i31_i8
61 ; VI: liveins: $vgpr0_vgpr1
63 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
64 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
65 ; VI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
66 %0:_(p0) = COPY $vgpr0_vgpr1
67 %1:_(s31) = G_SEXTLOAD %0 :: (load (s8), addrspace 0)
68 %2:_(s32) = G_ANYEXT %1
72 name: test_sextload_flat_i64_i8
77 ; SI-LABEL: name: test_sextload_flat_i64_i8
78 ; SI: liveins: $vgpr0_vgpr1
80 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
81 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
82 ; SI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
83 ; SI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
84 ; VI-LABEL: name: test_sextload_flat_i64_i8
85 ; VI: liveins: $vgpr0_vgpr1
87 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
88 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
89 ; VI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
90 ; VI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
91 %0:_(p0) = COPY $vgpr0_vgpr1
92 %1:_(s64) = G_SEXTLOAD %0 :: (load (s8), addrspace 0)
93 $vgpr0_vgpr1 = COPY %1
96 name: test_sextload_flat_i64_i16
101 ; SI-LABEL: name: test_sextload_flat_i64_i16
102 ; SI: liveins: $vgpr0_vgpr1
104 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
105 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
106 ; SI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
107 ; SI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
108 ; VI-LABEL: name: test_sextload_flat_i64_i16
109 ; VI: liveins: $vgpr0_vgpr1
111 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
112 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
113 ; VI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
114 ; VI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
115 %0:_(p0) = COPY $vgpr0_vgpr1
116 %1:_(s64) = G_SEXTLOAD %0 :: (load (s16), addrspace 0)
117 $vgpr0_vgpr1 = COPY %1
120 name: test_sextload_flat_i64_i32
123 liveins: $vgpr0_vgpr1
125 ; SI-LABEL: name: test_sextload_flat_i64_i32
126 ; SI: liveins: $vgpr0_vgpr1
128 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
129 ; SI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
130 ; SI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
131 ; SI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
132 ; VI-LABEL: name: test_sextload_flat_i64_i32
133 ; VI: liveins: $vgpr0_vgpr1
135 ; VI-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
136 ; VI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
137 ; VI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
138 ; VI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
139 %0:_(p0) = COPY $vgpr0_vgpr1
140 %1:_(s64) = G_SEXTLOAD %0 :: (load (s32), addrspace 0)
141 $vgpr0_vgpr1 = COPY %1