[llvm] [RFC][LTO] Allow target-specific module splittting (PR #83128)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 04:29:18 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff ca0560d8c821fa93e34cf84362fd523b546ba426 c950e8a84d5a450dfb051eda0a2bfa48921deeda -- llvm/include/llvm/Target/TargetMachine.h llvm/lib/LTO/LTOBackend.cpp llvm/tools/llvm-split/llvm-split.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h
index 43342c3e47..dec7a82b8b 100644
--- a/llvm/include/llvm/Target/TargetMachine.h
+++ b/llvm/include/llvm/Target/TargetMachine.h
@@ -422,7 +422,9 @@ public:
   /// Entry point for module splitting. Targets can implement custom module
   /// splitting logic, mainly used by LTO for --lto-partitions.
   ///
-  /// \returns `true` if the module was split, `false` otherwise. When  `false` is returned, it is assumed that \p ModuleCallback has never been called and \p M has not been modified.
+  /// \returns `true` if the module was split, `false` otherwise. When  `false`
+  /// is returned, it is assumed that \p ModuleCallback has never been called
+  /// and \p M has not been modified.
   virtual bool splitModule(
       Module &M, unsigned NumParts,
       function_ref<void(std::unique_ptr<Module> MPart)> ModuleCallback) const {
diff --git a/llvm/lib/LTO/LTOBackend.cpp b/llvm/lib/LTO/LTOBackend.cpp
index 494a8b0798..af2944c876 100644
--- a/llvm/lib/LTO/LTOBackend.cpp
+++ b/llvm/lib/LTO/LTOBackend.cpp
@@ -472,8 +472,9 @@ static void splitCodeGen(const Config &C, TargetMachine *TM,
 
   // Try target-specific module splitting first, then fallback to the default.
   if (!TM->splitModule(Mod, ParallelCodeGenParallelismLevel,
-                                HandleModulePartition)) {
-    SplitModule(Mod, ParallelCodeGenParallelismLevel, HandleModulePartition, false);
+                       HandleModulePartition)) {
+    SplitModule(Mod, ParallelCodeGenParallelismLevel, HandleModulePartition,
+                false);
   }
 
   // Because the inner lambda (which runs in a worker thread) captures our local

``````````

</details>


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


More information about the llvm-commits mailing list