llvm-project/llvm/test/CodeGen/AMDGPU/kernel_code_t_recurse.ll
Janek van Oirschot a699ccbf0c
MCExpr-ify amd_kernel_code_t (#91587)
Redefines the amd_kernel_code_t struct with MCExprs for members that would be
derived from SIProgramInfo MCExpr members.
2024-05-22 13:45:45 +01:00

25 lines
588 B
LLVM

; RUN: llc -mtriple=amdgcn-mesa-mesa3d < %s | FileCheck %s
; CHECK-LABEL: non_kernel_recursion:
define void @non_kernel_recursion(i32 %val) #2 {
%cmp = icmp eq i32 %val, 0
br i1 %cmp, label %ret, label %call
call:
%val.sub1 = sub i32 %val, 1
call void @non_kernel_recursion(i32 %val.sub1)
br label %ret
ret:
ret void
}
; CHECK-LABEL: kernel_caller_recursion:
; CHECK: .amd_kernel_code_t
; CHECK: is_dynamic_callstack = 1
; CHECK: .end_amd_kernel_code_t
define amdgpu_kernel void @kernel_caller_recursion(i32 %n) #0 {
call void @non_kernel_recursion(i32 %n)
ret void
}