xref: /llvm-project/llvm/test/CodeGen/AMDGPU/call-constant.ll (revision fac34c01f69f3591b6304953a15048ce6c5bd2b5)
1; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa < %s | FileCheck -check-prefixes=GCN,SDAG %s
2; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa < %s | FileCheck -check-prefixes=GCN,GISEL %s
3
4; GCN-LABEL: {{^}}test_call_undef:
5; GCN: s_endpgm
6define amdgpu_kernel void @test_call_undef() #0 {
7  %val = call i32 undef(i32 1)
8  %op = add i32 %val, 1
9  store volatile i32 %op, ptr addrspace(1) undef
10  ret void
11}
12
13; GCN-LABEL: {{^}}test_tail_call_undef:
14; SDAG: s_waitcnt
15; SDAG-NEXT: .Lfunc_end
16
17; GISEL: s_setpc_b64 s{{\[[0-9]+:[0-9]+\]}}
18define i32 @test_tail_call_undef() #0 {
19  %call = tail call i32 undef(i32 1)
20  ret i32 %call
21}
22
23; GCN-LABEL: {{^}}test_call_null:
24; GISEL: s_swappc_b64 s{{\[[0-9]+:[0-9]+\]}}, 0{{$}}
25; GCN: s_endpgm
26define amdgpu_kernel void @test_call_null() #0 {
27  %val = call i32 null(i32 1)
28  %op = add i32 %val, 1
29  store volatile i32 %op, ptr addrspace(1) null
30  ret void
31}
32
33; GCN-LABEL: {{^}}test_tail_call_null:
34; SDAG: s_waitcnt
35; SDAG-NEXT: .Lfunc_end
36
37; GISEL: s_setpc_b64 s{{\[[0-9]+:[0-9]+\]$}}
38define i32 @test_tail_call_null() #0 {
39  %call = tail call i32 null(i32 1)
40  ret i32 %call
41}
42