[PATCH] D146776: [llvm] Preliminary fat-lto-objects support
Paul Kirth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 26 19:16:47 PDT 2023
paulkirth added a comment.
In D146776#4299080 <https://reviews.llvm.org/D146776#4299080>, @tejohnson wrote:
> In D146776#4297327 <https://reviews.llvm.org/D146776#4297327>, @paulkirth wrote:
>
>> @tejohnson Do you have any thoughts here regarding the pipeline or other shortcomings this approach may have?
>
> Sorry for missing the earlier ping. I have some concerns about invoking just the ThinLTO prelink pipeline + the module optimization pipeline. Specifically, afaict this only invokes the module simplification pipeline once, with Phase == ThinLTOPreLink. If you search through buildModuleSimplificationPipeline for Phase, you will see there are certain things we only do if we are in the post link phase, or if we are not in the pre-link phase. We will miss out on some optimizations if we never invoke this again with a post link phase. For example, with SamplePGO, we only do indirect call promotion in the post link phase. We will miss out on ICP completely by never setting up the module simplification pipeline again with a post link phase. There are other examples, and additional ones if you look down into the inliner pipeline setups invoked from here and passed the phase.
Thanks for the feedback. After some trial and error, I think that running module simplification + module optimization should be a good first approximation of the default pipeline. Since the goal for FatLTO is to generate a section w/ LTO compatible bitcode + a text section roughly approximating the per TU `-O<n>` output I think that would get us there without introducing any obvious gotchas. It isn't ideal to run so many passes again, but from what I could tell it didn't seem like they would do anything //wrong//.
That said, I missed the differences in module simplification, so please let me know if that isn't accurate.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146776/new/
https://reviews.llvm.org/D146776
More information about the llvm-commits
mailing list