[all-commits] [llvm/llvm-project] 279c29: [ThinLTO] Use module hash instead of module ID for...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jul 28 07:46:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 279c2971951c2ea58a2bd1e6687ce61451f9d329
      https://github.com/llvm/llvm-project/commit/279c2971951c2ea58a2bd1e6687ce61451f9d329
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-07-28 (Fri, 28 Jul 2023)

  Changed paths:
    M llvm/lib/LTO/LTO.cpp
    A llvm/test/ThinLTO/X86/Inputs/cache-import-lists3.ll
    A llvm/test/ThinLTO/X86/Inputs/cache-import-lists4.ll
    A llvm/test/ThinLTO/X86/cache-decoupled-from-order.ll

  Log Message:
  -----------
  [ThinLTO] Use module hash instead of module ID for cache key

This is a followup to D151165. Instead of using the module ID, use
the module hash for sorting the import list. The module hash is what
will actually be included in the hash.

This has the advantage of being independent of the module order,
which is something that Rust relies on.

A caveat here is that the test doesn't quite work for linkonce_odr
functions, because the function may be imported from two different
modules, and the first one on the llvm-lto2 command line gets picked
(rather than, say, the prevailing copy). This doesn't really matter
for Rust's purposes (because it does not use linkonce_odr linkage),
but may still be worth addressing. For now I'm using a variant of
the test using internal instead of linkonce_odr functions.

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




More information about the All-commits mailing list