[PATCH] D135590: [ThinLTO][ELF] Add a ThinLTO warning if cache_size_bytes or cache_size_files is too small for the current link job.

Ying Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 10:51:28 PDT 2022


MaggieYi updated this revision to Diff 472686.
MaggieYi added a comment.
Herald added subscribers: pmatos, asb, aheejin, sbc100.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.

Update the patch following the reviewers' comments, which include:

1. Incorporate `checkCacheCapacity` into `pruneCache`.
2. Emit two warnings if a file is pruned due to reach both size and number limits. If both cache files' size and number exceed the limits, I think it's better to print separated warnings in order to let the user adjusts cache_size_bytes and cache_size_files at the same time.
3. Use llvm support 'llvm::errs()' to generate the warning.
4. Add support and lit tests for other lld formats: COFF, MachO and Wasm.
5. For COFF format, I removed 'WARN-NOT' check since the warning is printed twice. The reason is that 'LLD_IN_TEST' is set to 2 for COFF. 'LLD_IN_TEST' determines how many times `main` is run inside each process. Therefore, main is run twice which result in two warnings.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135590/new/

https://reviews.llvm.org/D135590

Files:
  lld/COFF/LTO.cpp
  lld/ELF/LTO.cpp
  lld/MachO/LTO.cpp
  lld/test/COFF/lto-cache-warnings.ll
  lld/test/ELF/lto/cache-warnings.ll
  lld/test/MachO/lto-cache-warnings.ll
  lld/test/wasm/lto/cache-warnings.ll
  lld/wasm/LTO.cpp
  llvm/include/llvm/Support/CachePruning.h
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/lib/Support/CachePruning.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135590.472686.patch
Type: text/x-patch
Size: 22734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221102/3fc8a284/attachment.bin>


More information about the llvm-commits mailing list