[flang-commits] [clang] [flang] [Flang][Driver] Support for -fsplit-lto-unit option in flang driver (PR #202858)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Wed Jun 10 07:58:46 PDT 2026


================
@@ -1065,6 +1065,12 @@ void CodeGenAction::runOptimizationPipeline(llvm::raw_pwrite_stream &os) {
       llvmModule->addModuleFlag(llvm::Module::Error, "ThinLTO", uint32_t(0));
     }
 
+    if (opts.PrepareForFullLTO && opts.EnableSplitLTOUnit && emitSummary &&
+        !llvmModule->getModuleFlag("EnableSplitLTOUnit")) {
+      llvmModule->addModuleFlag(llvm::Module::Error, "EnableSplitLTOUnit",
+                                uint32_t(1));
+    }
+
----------------
kkwli wrote:

How about `-flto=thin`?

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


More information about the flang-commits mailing list