Home | History | Annotate | Download | only in AMDGPU
      1 ; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -amdgpu-promote-alloca %s | FileCheck -check-prefix=OPT %s
      2 
      3 declare void @llvm.lifetime.start(i64, i8* nocapture) #0
      4 declare void @llvm.lifetime.end(i64, i8* nocapture) #0
      5 
      6 ; OPT-LABEL: @use_lifetime_promotable_lds(
      7 ; OPT-NOT: alloca i32
      8 ; OPT-NOT: llvm.lifetime
      9 ; OPT: store i32 %tmp3, i32 addrspace(3)*
     10 define void @use_lifetime_promotable_lds(i32 addrspace(1)* %arg) #2 {
     11 bb:
     12   %tmp = alloca i32, align 4
     13   %tmp1 = bitcast i32* %tmp to i8*
     14   call void @llvm.lifetime.start(i64 4, i8* %tmp1)
     15   %tmp2 = getelementptr inbounds i32, i32 addrspace(1)* %arg, i64 1
     16   %tmp3 = load i32, i32 addrspace(1)* %tmp2
     17   store i32 %tmp3, i32* %tmp
     18   call void @llvm.lifetime.end(i64 4, i8* %tmp1)
     19   ret void
     20 }
     21 
     22 attributes #0 = { argmemonly nounwind }
     23 attributes #1 = { nounwind readnone }
     24 attributes #2 = { nounwind }
     25