[clang] [llvm] [CGData][ThinLTO] Global Outlining with Two-CodeGen Rounds (PR #90933)
Kyungwoo Lee via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 30 07:25:31 PDT 2024
kyulee-com wrote:
@teresajohnson Here is the summary for the latest commit. Sorry about a few more dependent PRs whose commits also appear in this PR.
- Refactored `ThinBackend`, which was also a function, but is now a type. It's set up when an LTO object is created by the linker. I can now store the original parallelism of `ThinBackend` so that I could inherit this value for new ThinBackends (for first and second round runs). https://github.com/llvm/llvm-project/pull/110461
- Refactored `FileCache`, which was a function, but is now a type. It's set up by the linker, so it's hard to get the original cache directory. Alternatively, I could create a separate flag to cache these intermediate data for a two-round run only. Instead, I inherited this folder from the original `FileCache`, which is handy as the user doesn't need to specify anything additionally. https://github.com/llvm/llvm-project/pull/110463
- Added two sets of streams and caches backing them (in `StreamCacheData`):
- One for scratch object files from the first round.
- One for optimized IR files from the first round.
- Added `ExtraID` for `computeLTOCacheKey()`. This extra field is used to create distinct keys, as we now have three sets of streams and caches for potentially the same input bitcode. In addition to the two mentioned above (created in this LLVM pass), the last one has already been configured by the linker to produce the resulting object files for the linker.
- Removed file operations to access IR files. Like object files (either scratch or final), all data are backed by buffers. An explicit streamer/buffer is passed to `thinBackend` to access these IR files instead of relying on a global flag.
https://github.com/llvm/llvm-project/pull/90933
More information about the cfe-commits
mailing list