1 ; RUN: opt -S --amdgpu-annotate-uniform < %s | FileCheck -check-prefix=OPT %s
2 target datalayout = "A5"
5 ; OPT-LABEL: @amdgpu_noclobber_global(
6 ; OPT: %addr = getelementptr i32, i32 addrspace(1)* %in, i64 0, !amdgpu.uniform !0, !amdgpu.noclobber !0
7 ; OPT-NEXT: %load = load i32, i32 addrspace(1)* %addr, align 4
8 define amdgpu_kernel void @amdgpu_noclobber_global( i32 addrspace(1)* %in, i32 addrspace(1)* %out) {
10 %addr = getelementptr i32, i32 addrspace(1)* %in, i64 0
11 %load = load i32, i32 addrspace(1)* %addr, align 4
12 store i32 %load, i32 addrspace(1)* %out, align 4
16 ; OPT-LABEL: @amdgpu_noclobber_local(
17 ; OPT: %addr = getelementptr i32, i32 addrspace(3)* %in, i64 0, !amdgpu.uniform !0
18 ; OPT-NEXT: %load = load i32, i32 addrspace(3)* %addr, align 4
19 define amdgpu_kernel void @amdgpu_noclobber_local( i32 addrspace(3)* %in, i32 addrspace(1)* %out) {
21 %addr = getelementptr i32, i32 addrspace(3)* %in, i64 0
22 %load = load i32, i32 addrspace(3)* %addr, align 4
23 store i32 %load, i32 addrspace(1)* %out, align 4
27 ; OPT-LABEL: @amdgpu_noclobber_private(
28 ; OPT: %addr = getelementptr i32, i32 addrspace(5)* %in, i64 0, !amdgpu.uniform !0
29 ; OPT-NEXT: %load = load i32, i32 addrspace(5)* %addr, align 4
30 define amdgpu_kernel void @amdgpu_noclobber_private( i32 addrspace(5)* %in, i32 addrspace(1)* %out) {
32 %addr = getelementptr i32, i32 addrspace(5)* %in, i64 0
33 %load = load i32, i32 addrspace(5)* %addr, align 4
34 store i32 %load, i32 addrspace(1)* %out, align 4
38 ; OPT-LABEL: @amdgpu_noclobber_flat(
39 ; OPT: %addr = getelementptr i32, i32 addrspace(4)* %in, i64 0, !amdgpu.uniform !0
40 ; OPT-NEXT: %load = load i32, i32 addrspace(4)* %addr, align 4
41 define amdgpu_kernel void @amdgpu_noclobber_flat( i32 addrspace(4)* %in, i32 addrspace(1)* %out) {
43 %addr = getelementptr i32, i32 addrspace(4)* %in, i64 0
44 %load = load i32, i32 addrspace(4)* %addr, align 4
45 store i32 %load, i32 addrspace(1)* %out, align 4