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