1 ; RUN: llvm-split -o %t_s3_ %s -j 3 -mtriple amdgcn-amd-amdhsa -amdgpu-module-splitting-max-depth=2
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=2
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 @B()
19 ; SPLIT3-CHECK0: define internal void @HelperB()
20 ; SPLIT3-CHECK0: define internal void @HelperC()
21 ; SPLIT3-CHECK0: define amdgpu_kernel void @BC()
23 ; SPLIT3-CHECK1: define amdgpu_kernel void @A()
24 ; SPLIT3-CHECK1: define internal void @HelperA()
25 ; SPLIT3-CHECK1: define amdgpu_kernel void @C()
26 ; SPLIT3-CHECK1: define internal void @HelperC()
28 ; SPLIT3-CHECK2: define internal void @HelperA()
29 ; SPLIT3-CHECK2: define internal void @HelperB()
30 ; SPLIT3-CHECK2: define internal void @HelperC()
31 ; SPLIT3-CHECK2: define amdgpu_kernel void @AB()
32 ; SPLIT3-CHECK2: define amdgpu_kernel void @ABC()
34 ; --------------------------------------------
36 ; SPLIT5-CHECK0: define amdgpu_kernel void @A()
37 ; SPLIT5-CHECK0: define internal void @HelperA()
39 ; SPLIT5-CHECK1: define amdgpu_kernel void @B()
40 ; SPLIT5-CHECK1: define internal void @HelperB()
42 ; SPLIT5-CHECK2: define internal void @HelperB()
43 ; SPLIT5-CHECK2: define internal void @HelperC()
44 ; SPLIT5-CHECK2: define amdgpu_kernel void @BC()
46 ; SPLIT5-CHECK3: define amdgpu_kernel void @C()
47 ; SPLIT5-CHECK3: define internal void @HelperC()
49 ; SPLIT5-CHECK4: define internal void @HelperA()
50 ; SPLIT5-CHECK4: define internal void @HelperB()
51 ; SPLIT5-CHECK4: define internal void @HelperC()
52 ; SPLIT5-CHECK4: define amdgpu_kernel void @AB()
53 ; SPLIT5-CHECK4: define amdgpu_kernel void @ABC()
55 define amdgpu_kernel void @A() {
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
60 store volatile i64 42, ptr null
65 define internal void @HelperA() {
66 store volatile i32 42, ptr null
67 store volatile i32 42, ptr null
71 define amdgpu_kernel void @B() {
72 store volatile i64 42, ptr null
73 store volatile i64 42, ptr null
74 store volatile i64 42, ptr null
75 store volatile i64 42, ptr null
80 define internal void @HelperB() {
81 store volatile i32 42, ptr null
82 store volatile i32 42, ptr null
83 store volatile i32 42, ptr null
87 define amdgpu_kernel void @C() {
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
95 store volatile i64 42, ptr null
100 define internal void @HelperC() {
101 store volatile i32 42, ptr null
105 define amdgpu_kernel void @AB() {
106 store volatile i32 42, ptr null
112 define amdgpu_kernel void @BC() {
113 store volatile i32 42, ptr null
114 store volatile i32 42, ptr null
120 define amdgpu_kernel void @ABC() {