1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=bonaire -O0 -run-pass=legalizer -global-isel-abort=0 %s -o - | FileCheck -check-prefix=CI %s
5 name: test_load_constant32bit_s32_align1
10 ; CI-LABEL: name: test_load_constant32bit_s32_align1
11 ; CI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
12 ; CI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
13 ; CI: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
14 ; CI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[MV]](p4) :: (load 1, addrspace 6)
15 ; CI: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
16 ; CI: [[GEP:%[0-9]+]]:_(p4) = G_GEP [[MV]], [[C1]](s64)
17 ; CI: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[GEP]](p4) :: (load 1, addrspace 6)
18 ; CI: [[C2:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
19 ; CI: [[GEP1:%[0-9]+]]:_(p4) = G_GEP [[MV]], [[C2]](s64)
20 ; CI: [[LOAD2:%[0-9]+]]:_(s32) = G_LOAD [[GEP1]](p4) :: (load 1, addrspace 6)
21 ; CI: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
22 ; CI: [[GEP2:%[0-9]+]]:_(p4) = G_GEP [[MV]], [[C3]](s64)
23 ; CI: [[LOAD3:%[0-9]+]]:_(s32) = G_LOAD [[GEP2]](p4) :: (load 1, addrspace 6)
24 ; CI: [[C4:%[0-9]+]]:_(s16) = G_CONSTANT i16 255
25 ; CI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[LOAD]](s32)
26 ; CI: [[AND:%[0-9]+]]:_(s16) = G_AND [[TRUNC]], [[C4]]
27 ; CI: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
28 ; CI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C5]](s32)
29 ; CI: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
30 ; CI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[LOAD1]](s32)
31 ; CI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C6]]
32 ; CI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[COPY1]](s32)
33 ; CI: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
34 ; CI: [[OR:%[0-9]+]]:_(s16) = G_OR [[AND]], [[TRUNC1]]
35 ; CI: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[LOAD2]](s32)
36 ; CI: [[AND2:%[0-9]+]]:_(s16) = G_AND [[TRUNC2]], [[C4]]
37 ; CI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LOAD3]](s32)
38 ; CI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C6]]
39 ; CI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[AND3]], [[C5]](s32)
40 ; CI: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[SHL1]](s32)
41 ; CI: [[OR1:%[0-9]+]]:_(s16) = G_OR [[AND2]], [[TRUNC3]]
42 ; CI: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[OR]](s16)
43 ; CI: [[ZEXT1:%[0-9]+]]:_(s32) = G_ZEXT [[OR1]](s16)
44 ; CI: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
45 ; CI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[ZEXT1]], [[C7]](s32)
46 ; CI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[ZEXT]], [[SHL2]]
47 ; CI: $vgpr0 = COPY [[OR2]](s32)
48 %0:_(p6) = COPY $vgpr0
49 %1:_(s32) = G_LOAD %0 :: (load 4, align 1, addrspace 6)
54 name: test_load_constant32bit_s32_align4
59 ; CI-LABEL: name: test_load_constant32bit_s32_align4
60 ; CI: [[COPY:%[0-9]+]]:_(p6) = COPY $vgpr0
61 ; CI: [[C:%[0-9]+]]:_(p6) = G_CONSTANT i32 0
62 ; CI: [[MV:%[0-9]+]]:_(p4) = G_MERGE_VALUES [[COPY]](p6), [[C]](p6)
63 ; CI: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[MV]](p4) :: (load 4, addrspace 6)
64 ; CI: $vgpr0 = COPY [[LOAD]](s32)
65 %0:_(p6) = COPY $vgpr0
66 %1:_(s32) = G_LOAD %0 :: (load 4, align 4, addrspace 6)