[llvm] [AMDGPU][LTO] Introduce AMDGPUCloneModuleLDS (PR #89683)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 01:47:49 PDT 2024


================
@@ -0,0 +1,139 @@
+//===-- AMDGPUCloneModuleLDSPass.cpp ------------------------------*- C++ -*-=//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+//
+// The purpose of this pass is to ensure that the combined module contains
----------------
Pierre-vh wrote:

What the pass does and why it's needed is still unclear to me, so I have several concerns:

If I understand correctly, this is only needed for the LTO pipeline so I'd add a comment to say this runs before LowerModuleLDS in the FullLTO pipeline, and is used to improve eventual usage of --lto-partitions.

Does the pass affect codegen in any way when --lto-partitions is not used? If you add it everytime before LowerModuleLDS, does it change codegen in any tests?

I also don't see how this improves splitting. I guess it makes more isolated partitions if we clone functions, but #89245 already clones functions that are small enough and it has heuristics built in to minimize duplication for larger kernels/dependencies tree.



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


More information about the llvm-commits mailing list