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-prefix=SI
3 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -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: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
12 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
13 ; SI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
14 ; VI-LABEL: name: test_sextload_flat_i32_i8
15 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
16 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
17 ; VI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
18 %0:_(p0) = COPY $vgpr0_vgpr1
19 %1:_(s32) = G_SEXTLOAD %0 :: (load (s8), addrspace 0)
23 name: test_sextload_flat_i32_i16
28 ; SI-LABEL: name: test_sextload_flat_i32_i16
29 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
30 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
31 ; SI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
32 ; VI-LABEL: name: test_sextload_flat_i32_i16
33 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
34 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
35 ; VI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
36 %0:_(p0) = COPY $vgpr0_vgpr1
37 %1:_(s32) = G_SEXTLOAD %0 :: (load (s16), addrspace 0)
41 name: test_sextload_flat_i31_i8
46 ; SI-LABEL: name: test_sextload_flat_i31_i8
47 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
48 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
49 ; SI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
50 ; VI-LABEL: name: test_sextload_flat_i31_i8
51 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
52 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
53 ; VI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
54 %0:_(p0) = COPY $vgpr0_vgpr1
55 %1:_(s31) = G_SEXTLOAD %0 :: (load (s8), addrspace 0)
56 %2:_(s32) = G_ANYEXT %1
60 name: test_sextload_flat_i64_i8
65 ; SI-LABEL: name: test_sextload_flat_i64_i8
66 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
67 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
68 ; SI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
69 ; SI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
70 ; VI-LABEL: name: test_sextload_flat_i64_i8
71 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
72 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
73 ; VI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
74 ; VI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
75 %0:_(p0) = COPY $vgpr0_vgpr1
76 %1:_(s64) = G_SEXTLOAD %0 :: (load (s8), addrspace 0)
77 $vgpr0_vgpr1 = COPY %1
80 name: test_sextload_flat_i64_i16
85 ; SI-LABEL: name: test_sextload_flat_i64_i16
86 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
87 ; SI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
88 ; SI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
89 ; SI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
90 ; VI-LABEL: name: test_sextload_flat_i64_i16
91 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
92 ; VI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
93 ; VI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SEXTLOAD]](s32)
94 ; VI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
95 %0:_(p0) = COPY $vgpr0_vgpr1
96 %1:_(s64) = G_SEXTLOAD %0 :: (load (s16), addrspace 0)
97 $vgpr0_vgpr1 = COPY %1
100 name: test_sextload_flat_i64_i32
103 liveins: $vgpr0_vgpr1
105 ; SI-LABEL: name: test_sextload_flat_i64_i32
106 ; SI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
107 ; SI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
108 ; SI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
109 ; SI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
110 ; VI-LABEL: name: test_sextload_flat_i64_i32
111 ; VI: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
112 ; VI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
113 ; VI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
114 ; VI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
115 %0:_(p0) = COPY $vgpr0_vgpr1
116 %1:_(s64) = G_SEXTLOAD %0 :: (load (s32), addrspace 0)
117 $vgpr0_vgpr1 = COPY %1