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 %s -o - | FileCheck -check-prefix=SI %s
6 define i32 @widen_load_range0_tbaa(ptr addrspace(1) %ptr) {
7 %load = load i24, ptr addrspace(1) %ptr, !range !0, !tbaa !1
8 %zext = zext i24 %load to i32
12 define i32 @widen_load_range1_tbaa(ptr addrspace(1) %ptr) {
13 %load = load i24, ptr addrspace(1) %ptr, !range !0, !tbaa !1
14 %zext = zext i24 %load to i32
18 define i32 @widen_load_tbaa0(ptr addrspace(1) %ptr) {
19 %load = load i24, ptr addrspace(1) %ptr, !tbaa !1
20 %zext = zext i24 %load to i32
24 define i32 @widen_load_tbaa1(ptr addrspace(1) %ptr) {
25 %load = load i24, ptr addrspace(1) %ptr, !tbaa !1
26 %zext = zext i24 %load to i32
30 !0 = !{i24 0, i24 1048575}
31 !1 = !{!"omnipotent char", !2}
32 !2 = !{!"Simple C/C++ TBAA"}
35 # Make sure range metadata is not preserved when widening loads, but
38 name: widen_load_range0_tbaa
42 ; SI-LABEL: name: widen_load_range0_tbaa
43 ; SI: liveins: $vgpr0_vgpr1
45 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
46 ; SI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), !tbaa !1, addrspace 1)
47 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16777215
48 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[LOAD]], [[C]]
49 ; SI-NEXT: $vgpr0 = COPY [[AND]](s32)
50 %0:_(p1) = COPY $vgpr0_vgpr1
51 %1:_(s24) = G_LOAD %0 :: (load (s24), align 4, addrspace 1, !range !0, !tbaa !1)
57 # Result register type already matches the widened memory type.
59 name: widen_load_range1_tbaa
63 ; SI-LABEL: name: widen_load_range1_tbaa
64 ; SI: liveins: $vgpr0_vgpr1
66 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
67 ; SI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), !tbaa !1, addrspace 1)
68 ; SI-NEXT: $vgpr0 = COPY [[LOAD]](s32)
69 %0:_(p1) = COPY $vgpr0_vgpr1
70 %1:_(s32) = G_LOAD %0 :: (load (s24), align 4, addrspace 1, !range !0, !tbaa !1)
75 name: widen_load_tbaa0
79 ; SI-LABEL: name: widen_load_tbaa0
80 ; SI: liveins: $vgpr0_vgpr1
82 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
83 ; SI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), !tbaa !1, addrspace 1)
84 ; SI-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16777215
85 ; SI-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[LOAD]], [[C]]
86 ; SI-NEXT: $vgpr0 = COPY [[AND]](s32)
87 %0:_(p1) = COPY $vgpr0_vgpr1
88 %1:_(s24) = G_LOAD %0 :: (load (s24), align 4, addrspace 1, !tbaa !1)
94 # Result register type already matches the widened memory type.
96 name: widen_load_tbaa1
100 ; SI-LABEL: name: widen_load_tbaa1
101 ; SI: liveins: $vgpr0_vgpr1
103 ; SI-NEXT: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
104 ; SI-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p1) :: (load (s32), !tbaa !1, addrspace 1)
105 ; SI-NEXT: $vgpr0 = COPY [[LOAD]](s32)
106 %0:_(p1) = COPY $vgpr0_vgpr1
107 %1:_(s32) = G_LOAD %0 :: (load (s24), align 4, addrspace 1, !tbaa !1)