[all-commits] [llvm/llvm-project] e33db2: Reland "[ThinLTO] Populate declaration import stat...

Mingming Liu via All-commits all-commits at lists.llvm.org
Mon May 20 08:55:52 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e33db249b53fb70dce62db3ebd82d42239bd1d9d
      https://github.com/llvm/llvm-project/commit/e33db249b53fb70dce62db3ebd82d42239bd1d9d
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2024-05-20 (Mon, 20 May 2024)

  Changed paths:
    M llvm/include/llvm/IR/ModuleSummaryIndex.h
    M llvm/include/llvm/Transforms/IPO/FunctionImport.h
    M llvm/lib/LTO/LTO.cpp
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/test/ThinLTO/X86/funcimport-stats.ll
    A llvm/test/ThinLTO/X86/import_callee_declaration.ll
    M llvm/test/Transforms/FunctionImport/funcimport.ll
    M llvm/tools/llvm-link/llvm-link.cpp

  Log Message:
  -----------
  Reland "[ThinLTO] Populate declaration import status except for distributed ThinLTO under a default-off new option" (#92718)

The original PR is reviewed in
https://github.com/llvm/llvm-project/pull/88024, and this PR adds one
line (https://github.com/llvm/llvm-project/pull/92718/commits/b9f04d199dec4f3c221d981dcb91e55298d0693f)
to fix test

Limit to one thread for in-process ThinLTO to test `LLVM_DEBUG` log.
- This should fix build bot failure like
https://lab.llvm.org/buildbot/#/builders/259/builds/4727 and
https://lab.llvm.org/buildbot/#/builders/9/builds/43876
- I could repro the failure and see interleaved log messages by using
`-thinlto-threads=all`

**Original Commit Message:**

The goal is to populate `declaration` import status if a new flag
`-import-declaration` is on.

* For in-process ThinLTO, the `declaration` status is visible to backend
`function-import` pass, so `FunctionImporter::importFunctions` should
read the import status and be no-op for declaration summaries.
Basically, the postlink pipeline is updated to keep its current behavior
(import definitions), but not updated to handle `declaration` summaries.
Two use cases ([better call-graph
sort](https://discourse.llvm.org/t/rfc-for-better-call-graph-sort-build-a-more-complete-call-graph-by-adding-more-indirect-call-edges/74029#support-cross-module-function-declaration-import-5)
or [cross-module
auto-init](https://github.com/llvm/llvm-project/pull/87597#discussion_r1556067195))
would use this bit differently.

* For distributed ThinLTO, the `declaration` status is not serialized to
bitcode. As discussed, https://github.com/llvm/llvm-project/pull/87600
will do this.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list