[clang] [llvm] [ThinLTO][Split] Split module for parallel compilation in backend (1/N) (PR #198702)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 29 02:01:46 PDT 2026
================
----------------
mmjjpp wrote:
I reconsidering the !F.isDefinitionExact() part of this condition. My original intent was to be conservative: these functions (weak/linkonce/etc.) have definitions that may be replaced at link time, so I wanted to ensure only one partition keeps the real definition and others get available_externally.
However, I'm now leaning towards removing it. Functions with non-exact definitions (weak, linkonce, etc.) are inherently designed to support multiple definitions — the linker deduplicates them at link time, so there is no duplicate symbol risk. If such a function is defined in multiple partitions, the linker will select one definition regardless, so forcing available_externally on the duplicates is unnecessary.
After the change, the condition would simplify to:
if (!F.isDeclaration() && F.hasExternalLinkage())
externalFunction[&F] = true;
This still covers all functions that would actually cause duplicate symbol issues (both originally-external functions and locals promoted to external by externalize()).
What do you think? Is there a case I'm missing where keeping the !isDefinitionExact() check would be important?
https://github.com/llvm/llvm-project/pull/198702
More information about the llvm-commits
mailing list