brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 2bd8a28 Raw
36 lines · plain
1; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -passes=amdgpu-promote-alloca %s | FileCheck -check-prefix=OPT %s2 3declare void @llvm.lifetime.start.p5(i64, ptr addrspace(5) nocapture) #04declare void @llvm.lifetime.end.p5(i64, ptr addrspace(5) nocapture) #05 6; OPT-LABEL: @use_lifetime_promotable_lds(7; OPT-NOT: alloca i328; OPT-NOT: llvm.lifetime9; OPT: store i32 %tmp3, ptr addrspace(3)10define amdgpu_kernel void @use_lifetime_promotable_lds(ptr addrspace(1) %arg) #2 {11bb:12  %tmp = alloca i32, align 4, addrspace(5)13  call void @llvm.lifetime.start.p5(i64 4, ptr addrspace(5) %tmp)14  %tmp2 = getelementptr inbounds i32, ptr addrspace(1) %arg, i64 115  %tmp3 = load i32, ptr addrspace(1) %tmp216  store i32 %tmp3, ptr addrspace(5) %tmp17  call void @llvm.lifetime.end.p5(i64 4, ptr addrspace(5) %tmp)18  ret void19}20 21; After handling the alloca, the lifetime was erased. This was the22; next iterator to be checked as an alloca, crashing.23 24; OPT-LABEL: @iterator_erased_lifetime(25; OPT-NOT: alloca i826define amdgpu_kernel void @iterator_erased_lifetime() {27entry:28  %alloca = alloca i8, align 1, addrspace(5)29  call void @llvm.lifetime.start.p5(i64 1, ptr addrspace(5) %alloca)30  ret void31}32 33attributes #0 = { argmemonly nounwind }34attributes #1 = { nounwind readnone }35attributes #2 = { nounwind }36