[llvm] [AMDGPU] Add AMDGPU-specific module splitting (PR #89245)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 06:32:12 PDT 2024


================
@@ -0,0 +1,738 @@
+//===- AMDGPUSplitModule.cpp ----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+/// \file Implements a module splitting algorithm designed to support the
+/// FullLTO --lto-partitions option for parallel codegen. This is completely
+/// different from the common SplitModule pass, as this system is designed with
+/// AMDGPU in mind.
+///
+/// The basic idea of this module splitting implementation is the same as
+/// SplitModule: load-balance the module's functions across a set of N
+/// partitions to allow parallel codegen. However, it does it very
+/// differently than the target-agnostic variant:
+///   - Kernels are used as the module's "roots".
+///     They're known entry points on AMDGPU, and everything else is often
+///     internal only.
----------------
arsenm wrote:

Is this different than running the internalize-non-kernels pass and running the generic split? 

https://github.com/llvm/llvm-project/pull/89245


More information about the llvm-commits mailing list