[clang] [llvm] [DTLTO] Serialize of LTO Config (PR #219894)
Teresa Johnson via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 2 12:00:13 PST 2026
teresajohnson wrote:
> @teresajohnson, Could you please elaborate on your concerns about attaching a JSON blob to the summary index? If your concern is that the resulting summary index would no longer be compatible with llvm-bcanalyzer or llvm-dis, that should be relatively easy to address.
My main concern with putting this in the summary index isn't (just) llvm-dis/llvm-bcanalyzer support, it's that embedding linker-to-backend driver config as a json blob inside the structured bitcode format is fundamentally the wrong design imo. Also, the LTO config is link-wide, so embedding it in every .thinlto.bc shard duplicates it many times across all modules (which would be especially bad for large buffers like BBSectionsFuncListBuf).
Strong preference for @bd1976bris's earlier suggestion of a single separate file passed via a Clang option. Could you clarify why that would require source changes to distcc/Icecream? DTLTO already has common.inputs / common.args for shared files (like --lto-sample-profile), plus job.inputs for imported bitcode files. If a distributor already stages those, why can't it stage one more file in common.inputs?
I also agree with @arsenm and @cachemeifyoucan that we shouldn't macro rewrite and blindly serialize all of TargetOptions, MCTargetOptions, and PipelineTuningOptions. I don't think this completely avoids per-field handling anyway. Forwarding MllvmArgs as -mllvm in common.args (which already covers many/most TargetOptions set via lld) and keeping serialization to a small backend-only subset of lto::Config in a single separate file seems much cleaner.
https://github.com/llvm/llvm-project/pull/219894
More information about the cfe-commits
mailing list