
(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.
40 lines
896 B
LLVM
40 lines
896 B
LLVM
; RUN: llvm-split -o %t %s -j 4 -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
|
|
; RUN: llvm-dis -o - %t3 | FileCheck --check-prefix=CHECK3 %s
|
|
|
|
; Check that 4 independent kernels get put into 4 different partitions.
|
|
|
|
; CHECK0-NOT: define
|
|
; CHECK0: define amdgpu_kernel void @D
|
|
; CHECK0-NOT: define
|
|
|
|
; CHECK1-NOT: define
|
|
; CHECK1: define amdgpu_kernel void @C
|
|
; CHECK1-NOT: define
|
|
|
|
; CHECK2-NOT: define
|
|
; CHECK2: define amdgpu_kernel void @B
|
|
; CHECK2-NOT: define
|
|
|
|
; CHECK3-NOT: define
|
|
; CHECK3: define amdgpu_kernel void @A
|
|
; CHECK3-NOT: define
|
|
|
|
define amdgpu_kernel void @A() {
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @B() {
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @C() {
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_kernel void @D() {
|
|
ret void
|
|
}
|