annotate llvm/test/CodeGen/AMDGPU/function-call-relocs.ll @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji < %s | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 declare void @func(i32 addrspace(1)* %out)
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 declare protected void @protected_func(i32 addrspace(1)* %out)
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 declare hidden void @hidden_func(i32 addrspace(1)* %out)
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 ; CHECK-LABEL: call_func:
anatofuz
parents:
diff changeset
10 ; CHECK: s_getpc_b64 s{{\[}}[[PC_LO:[0-9]+]]:[[PC_HI:[0-9]+]]{{\]}}
anatofuz
parents:
diff changeset
11 ; CHECK: s_add_u32 s[[GOT_ADDR_LO:[0-9]+]], s[[PC_LO]], func@gotpcrel32@lo+4
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
12 ; CHECK: s_addc_u32 s[[GOT_ADDR_HI:[0-9]+]], s[[PC_HI]], func@gotpcrel32@hi+12
150
anatofuz
parents:
diff changeset
13 ; CHECK: s_load_dwordx2 s{{\[}}[[ADDR_LO:[0-9]+]]:[[ADDR_HI:[0-9]+]]{{\]}}, s{{\[}}[[GOT_ADDR_LO]]:[[GOT_ADDR_HI]]{{\]}}, 0x0
anatofuz
parents:
diff changeset
14 ; CHECK: s_swappc_b64 s{{\[}}{{[0-9]+:[0-9]+}}{{\]}}, s{{\[}}[[ADDR_LO]]:[[ADDR_HI]]{{\]}}
anatofuz
parents:
diff changeset
15 define amdgpu_kernel void @call_func(i32 addrspace(1)* %out) {
anatofuz
parents:
diff changeset
16 call void @func(i32 addrspace(1)* %out)
anatofuz
parents:
diff changeset
17 ret void
anatofuz
parents:
diff changeset
18 }
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 ; CHECK-LABEL: call_protected_func:
anatofuz
parents:
diff changeset
21 ; CHECK: s_getpc_b64 s{{\[}}[[PC_LO:[0-9]+]]:[[PC_HI:[0-9]+]]{{\]}}
anatofuz
parents:
diff changeset
22 ; CHECK: s_add_u32 s[[ADDR_LO:[0-9]+]], s[[PC_LO]], protected_func@rel32@lo+4
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
23 ; CHECK: s_addc_u32 s[[ADDR_HI:[0-9]+]], s[[PC_HI]], protected_func@rel32@hi+12
150
anatofuz
parents:
diff changeset
24 ; CHECK: s_swappc_b64 s{{\[}}{{[0-9]+:[0-9]+}}{{\]}}, s{{\[}}[[ADDR_LO]]:[[ADDR_HI]]{{\]}}
anatofuz
parents:
diff changeset
25 define amdgpu_kernel void @call_protected_func(i32 addrspace(1)* %out) {
anatofuz
parents:
diff changeset
26 call void @protected_func(i32 addrspace(1)* %out)
anatofuz
parents:
diff changeset
27 ret void
anatofuz
parents:
diff changeset
28 }
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 ; CHECK-LABEL: call_hidden_func:
anatofuz
parents:
diff changeset
31 ; CHECK: s_getpc_b64 s{{\[}}[[PC_LO:[0-9]+]]:[[PC_HI:[0-9]+]]{{\]}}
anatofuz
parents:
diff changeset
32 ; CHECK: s_add_u32 s[[ADDR_LO:[0-9]+]], s[[PC_LO]], hidden_func@rel32@lo+4
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
33 ; CHECK: s_addc_u32 s[[ADDR_HI:[0-9]+]], s[[PC_HI]], hidden_func@rel32@hi+12
150
anatofuz
parents:
diff changeset
34 ; CHECK: s_swappc_b64 s{{\[}}{{[0-9]+:[0-9]+}}{{\]}}, s{{\[}}[[ADDR_LO]]:[[ADDR_HI]]{{\]}}
anatofuz
parents:
diff changeset
35 define amdgpu_kernel void @call_hidden_func(i32 addrspace(1)* %out) {
anatofuz
parents:
diff changeset
36 call void @hidden_func(i32 addrspace(1)* %out)
anatofuz
parents:
diff changeset
37 ret void
anatofuz
parents:
diff changeset
38 }
anatofuz
parents:
diff changeset
39
anatofuz
parents:
diff changeset
40 declare i64 @funci()
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 ; CHECK-LABEL: tail_call_func:
anatofuz
parents:
diff changeset
43 ; CHECK: s_getpc_b64 s{{\[}}[[PC_LO:[0-9]+]]:[[PC_HI:[0-9]+]]{{\]}}
anatofuz
parents:
diff changeset
44 ; CHECK: s_add_u32 s[[GOT_ADDR_LO:[0-9]+]], s[[PC_LO]], funci@gotpcrel32@lo+4
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
45 ; CHECK: s_addc_u32 s[[GOT_ADDR_HI:[0-9]+]], s[[PC_HI]], funci@gotpcrel32@hi+12
150
anatofuz
parents:
diff changeset
46 ; CHECK: s_load_dwordx2 s{{\[}}[[ADDR_LO:[0-9]+]]:[[ADDR_HI:[0-9]+]]{{\]}}, s{{\[}}[[GOT_ADDR_LO]]:[[GOT_ADDR_HI]]{{\]}}, 0x0
anatofuz
parents:
diff changeset
47 ; CHECK: s_setpc_b64 s{{\[}}[[ADDR_LO]]:[[ADDR_HI]]{{\]}}
anatofuz
parents:
diff changeset
48 define i64 @tail_call_func() {
anatofuz
parents:
diff changeset
49 %ret = tail call i64 @funci()
anatofuz
parents:
diff changeset
50 ret i64 %ret
anatofuz
parents:
diff changeset
51 }