[PATCH] D99554: [ThinLTO] During module importing, close one source module before open another one for distributed mode.

Wei Mi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 29 17:13:25 PDT 2021


wmi created this revision.
wmi added a reviewer: tejohnson.
Herald added subscribers: steven_wu, hiraditya, inglorion.
wmi requested review of this revision.
Herald added projects: clang, LLVM.
Herald added a subscriber: cfe-commits.

Currently during module importing, ThinLTO opens all the source modules, collect functions to be imported and append them to the destination module, then leave all the modules open through out the lto backend pipeline. This patch refactors it in the way that one source module will be closed before another source module is opened. All the source modules will be closed after importing phase is done. It will save some amount of memory when there are many source modules to be imported.

Note that this patch only changes the distributed thinlto mode. For in process thinlto mode, one source module is shared acorss different thinlto backend threads so it is not changed in this patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99554

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/test/CodeGen/thinlto_backend.ll
  llvm/include/llvm/LTO/LTOBackend.h
  llvm/lib/LTO/LTO.cpp
  llvm/lib/LTO/LTOBackend.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99554.334017.patch
Type: text/x-patch
Size: 7973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210330/dadf2a3a/attachment-0001.bin>


More information about the cfe-commits mailing list