24 lines · plain
1; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -passes=amdgpu-promote-alloca < %s | FileCheck %s2 3; This is just an arbitrary intrinisic that shouldn't be4; handled to ensure it doesn't crash.5 6declare void @llvm.stackrestore.p5(ptr addrspace(5)) #27 8; CHECK-LABEL: @try_promote_unhandled_intrinsic(9; CHECK: alloca10; CHECK: call void @llvm.stackrestore.p5(ptr addrspace(5) %tmp)11define amdgpu_kernel void @try_promote_unhandled_intrinsic(ptr addrspace(1) %arg) #2 {12bb:13 %tmp = alloca i32, addrspace(5)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.stackrestore.p5(ptr addrspace(5) %tmp)18 ret void19}20 21attributes #0 = { argmemonly nounwind }22attributes #1 = { nounwind readnone }23attributes #2 = { nounwind }24