1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=bonaire -O0 -run-pass=legalizer %s -o - | FileCheck -check-prefix=CI %s
3 # FIXME: Run with and without unaligned access on
6 name: test_sextload_constant32bit_s64_s32_align4
11 ; CI-LABEL: name: test_sextload_constant32bit_s64_s32_align4
14 ; CI-NEXT: [[COPY:%[0-9]+]]:_(p6) = COPY $sgpr0
15 ; CI-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p6)
16 ; CI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
17 ; CI-NEXT: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[PTRTOINT]](s32), [[C]](s32)
18 ; CI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[MV]](p4) :: (load (s32), addrspace 6)
19 ; CI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
20 ; CI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
21 %0:_(p6) = COPY $sgpr0
22 %1:_(s64) = G_SEXTLOAD %0 :: (load (s32), align 4, addrspace 6)
23 $vgpr0_vgpr1 = COPY %1
27 name: test_sextload_constant32bit_s64_s32_align2
32 ; CI-LABEL: name: test_sextload_constant32bit_s64_s32_align2
35 ; CI-NEXT: [[COPY:%[0-9]+]]:_(p6) = COPY $sgpr0
36 ; CI-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p6)
37 ; CI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
38 ; CI-NEXT: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[PTRTOINT]](s32), [[C]](s32)
39 ; CI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[MV]](p4) :: (load (s32), align 2, addrspace 6)
40 ; CI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
41 ; CI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
42 %0:_(p6) = COPY $sgpr0
43 %1:_(s64) = G_SEXTLOAD %0 :: (load (s32), align 2, addrspace 6)
44 $vgpr0_vgpr1 = COPY %1
48 name: test_sextload_constant32bit_s64_s32_align1
53 ; CI-LABEL: name: test_sextload_constant32bit_s64_s32_align1
56 ; CI-NEXT: [[COPY:%[0-9]+]]:_(p6) = COPY $sgpr0
57 ; CI-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p6)
58 ; CI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
59 ; CI-NEXT: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[PTRTOINT]](s32), [[C]](s32)
60 ; CI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[MV]](p4) :: (load (s32), align 1, addrspace 6)
61 ; CI-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[LOAD]](s32)
62 ; CI-NEXT: $vgpr0_vgpr1 = COPY [[SEXT]](s64)
63 %0:_(p6) = COPY $sgpr0
64 %1:_(s64) = G_SEXTLOAD %0 :: (load (s32), align 1, addrspace 6)
65 $vgpr0_vgpr1 = COPY %1
69 name: test_sextload_constant32bit_s32_s8_align1
74 ; CI-LABEL: name: test_sextload_constant32bit_s32_s8_align1
77 ; CI-NEXT: [[COPY:%[0-9]+]]:_(p6) = COPY $sgpr0
78 ; CI-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p6)
79 ; CI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
80 ; CI-NEXT: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[PTRTOINT]](s32), [[C]](s32)
81 ; CI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[MV]](p4) :: (load (s8), addrspace 6)
82 ; CI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
83 %0:_(p6) = COPY $sgpr0
84 %1:_(s32) = G_SEXTLOAD %0 :: (load (s8), align 1, addrspace 6)
89 name: test_sextload_constant32bit_s32_s16_align2
94 ; CI-LABEL: name: test_sextload_constant32bit_s32_s16_align2
97 ; CI-NEXT: [[COPY:%[0-9]+]]:_(p6) = COPY $sgpr0
98 ; CI-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p6)
99 ; CI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
100 ; CI-NEXT: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[PTRTOINT]](s32), [[C]](s32)
101 ; CI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[MV]](p4) :: (load (s16), addrspace 6)
102 ; CI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
103 %0:_(p6) = COPY $sgpr0
104 %1:_(s32) = G_SEXTLOAD %0 :: (load (s16), align 2, addrspace 6)
109 name: test_sextload_constant32bit_s32_s16_align1
114 ; CI-LABEL: name: test_sextload_constant32bit_s32_s16_align1
115 ; CI: liveins: $sgpr0
117 ; CI-NEXT: [[COPY:%[0-9]+]]:_(p6) = COPY $sgpr0
118 ; CI-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p6)
119 ; CI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
120 ; CI-NEXT: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[PTRTOINT]](s32), [[C]](s32)
121 ; CI-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[MV]](p4) :: (load (s16), align 1, addrspace 6)
122 ; CI-NEXT: $vgpr0 = COPY [[SEXTLOAD]](s32)
123 %0:_(p6) = COPY $sgpr0
124 %1:_(s32) = G_SEXTLOAD %0 :: (load (s16), align 1, addrspace 6)