aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/AMDGPU/kernel_code_t_recurse.ll
blob: cdd6e88dd103b770021d7dd98b6fd91add1e94e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; 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
}