[PATCH] D156730: [LTO] Remove module id from summary index

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 12:37:07 PDT 2023


tejohnson created this revision.
tejohnson added reviewers: pcc, MaskRay.
Herald added subscribers: ormris, arphaman, steven_wu, mgrang, hiraditya, inglorion.
Herald added a project: All.
tejohnson requested review of this revision.
Herald added a subscriber: wangpc.
Herald added a project: LLVM.

The module paths string table mapped to both an id sequentially assigned
during LTO linking, and the module hash. The former is leftover from
before the module hash was added for caching and subsequently replaced
use of the module id when renaming promoted symbols (to avoid affects
due to link order changes). The sequentially assigned module id was not
removed, however, as it was still a convenience when serializing to/from
bitcode and assembly.

This patch removes the module id from this table, since it isn't
strictly needed and can lead to confusion on when it is appropriate to
use (e.g. see fix in D156525 <https://reviews.llvm.org/D156525>). It also takes a (likely not significant)
amount of overhead. Where an integer module id is needed (e.g. bitcode
writing), one is assigned on the fly.

There are a couple of test changes since the paths are now sorted
alphanumerically when assigning ids on the fly during assembly writing,
in order to ensure deterministic behavior.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156730

Files:
  lld/test/COFF/thinlto-index-only.ll
  llvm/include/llvm/Bitcode/BitcodeReader.h
  llvm/include/llvm/IR/ModuleSummaryIndex.h
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/ModuleSummaryIndex.cpp
  llvm/lib/IRPrinter/IRPrintingPasses.cpp
  llvm/lib/LTO/LTO.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/test/Assembler/thinlto-multiple-summaries-for-guid.ll
  llvm/test/ThinLTO/X86/dot-dumper-full-lto.ll
  llvm/tools/llvm-lto/llvm-lto.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156730.545759.patch
Type: text/x-patch
Size: 23262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230731/3f34c11d/attachment.bin>


More information about the llvm-commits mailing list