1 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn-- -mattr=+promote-alloca -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2 target datalayout = "A5"
4 declare ptr @llvm.invariant.start.p5(i64, ptr addrspace(5) nocapture) #0
5 declare void @llvm.invariant.end.p5(ptr, i64, ptr addrspace(5) nocapture) #0
6 declare ptr addrspace(5) @llvm.launder.invariant.group.p5(ptr addrspace(5)) #1
8 ; GCN-LABEL: {{^}}use_invariant_promotable_lds:
9 ; GCN: buffer_load_dword
11 define amdgpu_kernel void @use_invariant_promotable_lds(ptr addrspace(1) %arg) #2 {
13 %tmp = alloca i32, align 4, addrspace(5)
14 %tmp2 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 1
15 %tmp3 = load i32, ptr addrspace(1) %tmp2
16 store i32 %tmp3, ptr addrspace(5) %tmp
17 %tmp4 = call ptr @llvm.invariant.start.p5(i64 4, ptr addrspace(5) %tmp) #0
18 call void @llvm.invariant.end.p5(ptr %tmp4, i64 4, ptr addrspace(5) %tmp) #0
19 %tmp5 = call ptr addrspace(5) @llvm.launder.invariant.group.p5(ptr addrspace(5) %tmp) #1
23 attributes #0 = { argmemonly nounwind }
24 attributes #1 = { nounwind readnone }
25 attributes #2 = { nounwind }