[llvm] [AMDGPU] Add AMDGPU-specific module splitting (PR #89245)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu May 9 11:02:58 PDT 2024
================
@@ -0,0 +1,44 @@
+; 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 use private/internal global variables.
+; The GVs should be copied in each partition as needed.
+
+; CHECK0-NOT: define
+; CHECK0: @foo = hidden constant ptr undef
+; CHECK0: @bar = hidden constant ptr undef
+; CHECK0: define amdgpu_kernel void @C
+; CHECK0-NOT: define
+
+; CHECK1-NOT: define
+; CHECK1: @foo = external hidden constant ptr{{$}}
+; CHECK1: @bar = external hidden constant ptr{{$}}
+; CHECK1: define amdgpu_kernel void @A
+; CHECK1-NOT: define
+
+; CHECK2-NOT: define
+; CHECK2: @foo = external hidden constant ptr{{$}}
+; CHECK2: @bar = external hidden constant ptr{{$}}
+; CHECK2: define amdgpu_kernel void @B
+; CHECK2-NOT: define
+
+ at foo = private constant ptr undef
+ at bar = internal constant ptr undef
----------------
arsenm wrote:
```suggestion
@foo = private constant ptr poison
@bar = internal constant ptr poison
```
https://github.com/llvm/llvm-project/pull/89245
More information about the llvm-commits
mailing list