[all-commits] [llvm/llvm-project] bbe8cd: [LTO] Remove module id from summary index

Teresa Johnson via All-commits all-commits at lists.llvm.org
Fri Sep 1 13:43:37 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bbe8cd13335300958b04db5318c31ff52714f96f
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2023-09-01 (Fri, 01 Sep 2023)

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

  Log Message:
  [LTO] Remove module id from summary index

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). 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.

Differential Revision: https://reviews.llvm.org/D156730

More information about the All-commits mailing list