1 ; RUN: llvm-split -o %t_s3_ %s -j 3 -mtriple amdgcn-amd-amdhsa -amdgpu-module-splitting-max-depth=8
2 ; RUN: llvm-dis -o - %t_s3_0 | FileCheck --check-prefix=SPLIT3-CHECK0 --implicit-check-not=define %s
3 ; RUN: llvm-dis -o - %t_s3_1 | FileCheck --check-prefix=SPLIT3-CHECK1 --implicit-check-not=define %s
4 ; RUN: llvm-dis -o - %t_s3_2 | FileCheck --check-prefix=SPLIT3-CHECK2 --implicit-check-not=define %s
6 ; RUN: llvm-split -o %t_s5_ %s -j 5 -mtriple amdgcn-amd-amdhsa -amdgpu-module-splitting-max-depth=8
7 ; RUN: llvm-dis -o - %t_s5_0 | FileCheck --check-prefix=SPLIT5-CHECK0 --implicit-check-not=define %s
8 ; RUN: llvm-dis -o - %t_s5_1 | FileCheck --check-prefix=SPLIT5-CHECK1 --implicit-check-not=define %s
9 ; RUN: llvm-dis -o - %t_s5_2 | FileCheck --check-prefix=SPLIT5-CHECK2 --implicit-check-not=define %s
10 ; RUN: llvm-dis -o - %t_s5_3 | FileCheck --check-prefix=SPLIT5-CHECK3 --implicit-check-not=define %s
11 ; RUN: llvm-dis -o - %t_s5_4 | FileCheck --check-prefix=SPLIT5-CHECK4 --implicit-check-not=define %s
13 ; Test the specifics of the search algorithm.
14 ; This test will change depending on new heuristics we add or remove.
16 ; --------------------------------------------
18 ; SPLIT3-CHECK0: define amdgpu_kernel void @A()
19 ; SPLIT3-CHECK0: define internal void @HelperA()
20 ; SPLIT3-CHECK0: define amdgpu_kernel void @B()
21 ; SPLIT3-CHECK0: define internal void @HelperB()
23 ; SPLIT3-CHECK1: define amdgpu_kernel void @C()
24 ; SPLIT3-CHECK1: define internal void @HelperC()
26 ; SPLIT3-CHECK2: define internal void @HelperA()
27 ; SPLIT3-CHECK2: define internal void @HelperB()
28 ; SPLIT3-CHECK2: define internal void @HelperC()
29 ; SPLIT3-CHECK2: define amdgpu_kernel void @AB()
30 ; SPLIT3-CHECK2: define amdgpu_kernel void @BC()
31 ; SPLIT3-CHECK2: define amdgpu_kernel void @ABC()
33 ; --------------------------------------------
35 ; SPLIT5-CHECK0: define amdgpu_kernel void @A()
36 ; SPLIT5-CHECK0: define internal void @HelperA()
38 ; SPLIT5-CHECK1: define amdgpu_kernel void @B()
39 ; SPLIT5-CHECK1: define internal void @HelperB()
41 ; SPLIT5-CHECK2: define internal void @HelperB()
42 ; SPLIT5-CHECK2: define internal void @HelperC()
43 ; SPLIT5-CHECK2: define amdgpu_kernel void @BC
45 ; SPLIT5-CHECK3: define amdgpu_kernel void @C()
46 ; SPLIT5-CHECK3: define internal void @HelperC()
48 ; SPLIT5-CHECK4: define internal void @HelperA()
49 ; SPLIT5-CHECK4: define internal void @HelperB()
50 ; SPLIT5-CHECK4: define internal void @HelperC()
51 ; SPLIT5-CHECK4: define amdgpu_kernel void @AB()
52 ; SPLIT5-CHECK4: define amdgpu_kernel void @ABC()
54 define amdgpu_kernel void @A() {
55 store volatile i64 42, ptr null
56 store volatile i64 42, ptr null
57 store volatile i64 42, ptr null
58 store volatile i64 42, ptr null
59 store volatile i64 42, ptr null
64 define internal void @HelperA() {
65 store volatile i32 42, ptr null
66 store volatile i32 42, ptr null
70 define amdgpu_kernel void @B() {
71 store volatile i64 42, ptr null
72 store volatile i64 42, ptr null
73 store volatile i64 42, ptr null
74 store volatile i64 42, ptr null
79 define internal void @HelperB() {
80 store volatile i32 42, ptr null
81 store volatile i32 42, ptr null
82 store volatile i32 42, ptr null
86 define amdgpu_kernel void @C() {
87 store volatile i64 42, ptr null
88 store volatile i64 42, ptr null
89 store volatile i64 42, ptr null
90 store volatile i64 42, ptr null
91 store volatile i64 42, ptr null
92 store volatile i64 42, ptr null
93 store volatile i64 42, ptr null
94 store volatile i64 42, ptr null
99 define internal void @HelperC() {
100 store volatile i32 42, ptr null
104 define amdgpu_kernel void @AB() {
105 store volatile i32 42, ptr null
111 define amdgpu_kernel void @BC() {
112 store volatile i32 42, ptr null
113 store volatile i32 42, ptr null
119 define amdgpu_kernel void @ABC() {