
(with fix for ubsan) This enables the --lto-partitions option to work more consistently. This module splitting logic is fully aware of AMDGPU modules and their specificities and takes advantage of them to split modules in a way that avoids compilation issue (such as resource usage being incorrectly represented). This also includes a logging system that's more elaborate than just LLVM_DEBUG which allows printing logs to uniquely named files, and optionally with all value names hidden so they can be safely shared without leaking informatiton about the source. Logs can also be enabled through an environment variable, which avoids the sometimes complicated process of passing a -mllvm option all the way from clang driver to the offload linker that handles full LTO codegen.
51 lines
1.0 KiB
LLVM
51 lines
1.0 KiB
LLVM
; RUN: llvm-split -o %t %s -j 3 -mtriple amdgcn-amd-amdhsa
|
|
; RUN: llvm-dis -o - %t0 | FileCheck --check-prefix=CHECK0 %s
|
|
; RUN: llvm-dis -o - %t1 | FileCheck --check-prefix=CHECK1 %s
|
|
; RUN: llvm-dis -o - %t2 | FileCheck --check-prefix=CHECK2 %s
|
|
|
|
; 3 kernels with each their own dependencies should go into 3
|
|
; distinct partitions.
|
|
|
|
; CHECK0-NOT: define
|
|
; CHECK0: define amdgpu_kernel void @C
|
|
; CHECK0: define internal void @HelperC
|
|
; CHECK0-NOT: define
|
|
|
|
; CHECK1-NOT: define
|
|
; CHECK1: define amdgpu_kernel void @B
|
|
; CHECK1: define internal void @HelperB
|
|
; CHECK1-NOT: define
|
|
|
|
; CHECK2-NOT: define
|
|
; CHECK2: define amdgpu_kernel void @A
|
|
; CHECK2: define internal void @HelperA
|
|
; CHECK2-NOT: define
|
|
|
|
|
|
define amdgpu_kernel void @A() {
|
|
call void @HelperA()
|
|
ret void
|
|
}
|
|
|
|
define internal void @HelperA() {
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @B() {
|
|
call void @HelperB()
|
|
ret void
|
|
}
|
|
|
|
define internal void @HelperB() {
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @C() {
|
|
call void @HelperC()
|
|
ret void
|
|
}
|
|
|
|
define internal void @HelperC() {
|
|
ret void
|
|
}
|