[clang] [llvm] [ThinLTO][Split] Split module for parallel compilation in backend (1/N) (PR #198702)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 00:53:32 PDT 2026
mmjjpp wrote:
Now that PR #221181 has been merged, I have rebased the changes and updated the unnamed.ll test accordingly.
During this process, I discovered a bug in the original logic: sorting the FWDWorkList was happening before externalizeGlobal() was called. Because our sorting comparator falls back to alphabetical name comparison when costs are identical, sorting unnamed internal functions (like @0 and @1) before they receive their stable names leads to non-deterministic ordering. This non-determinism can result in inconsistent partitioning.
To fix this, I extracted the sorting logic into sortWorkList() and deferred its execution until after all globals are externalized and assigned stable names.
@teresajohnson , please let me know if you have any questions or further comments.
https://github.com/llvm/llvm-project/pull/198702
More information about the cfe-commits
mailing list