1 ; RUN: llvm-split -o %t %s -j 2 -mtriple amdgcn-amd-amdhsa -amdgpu-module-splitting-large-threshold=0
2 ; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
3 ; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
7 ; - B is storing @HelperA/B's address
9 ; The helper functions should get externalized (become hidden w/ external linkage)
11 ; CHECK0: define hidden void @HelperA()
12 ; CHECK0: define hidden void @HelperB()
13 ; CHECK0: define amdgpu_kernel void @A()
14 ; CHECK0: declare amdgpu_kernel void @B(i1, ptr)
16 ; CHECK1: declare hidden void @HelperA()
17 ; CHECK1: declare hidden void @HelperB()
18 ; CHECK1: declare amdgpu_kernel void @A()
19 ; CHECK1: define amdgpu_kernel void @B(i1 %cond, ptr %dst)
21 define internal void @HelperA() {
25 define internal void @HelperB() {
29 define amdgpu_kernel void @A() {
33 define amdgpu_kernel void @B(i1 %cond, ptr %dst) {
34 %addr = select i1 %cond, ptr @HelperA, ptr @HelperB
35 store ptr %addr, ptr %dst