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