[all-commits] [llvm/llvm-project] 6faf17: [ThinLTO]Supports declaration import for global va...

Mingming Liu via All-commits all-commits at lists.llvm.org
Mon Dec 2 16:16:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6faf17b7626bfdeea977a7a333c6e20ed677615d
      https://github.com/llvm/llvm-project/commit/6faf17b7626bfdeea977a7a333c6e20ed677615d
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2024-12-02 (Mon, 02 Dec 2024)

  Changed paths:
    M llvm/include/llvm/IR/ModuleSummaryIndex.h
    M llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
    M llvm/lib/IR/ModuleSummaryIndex.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/test/ThinLTO/X86/import_callee_declaration.ll

  Log Message:
  -----------
  [ThinLTO]Supports declaration import for global variables in distributed ThinLTO (#117616)

When `-import-declaration` option is enabled, declaration import is
supported for functions. https://github.com/llvm/llvm-project/pull/88024
has the context for this option.

This patch supports declaration import for global variables in
distributed ThinLTO. The motivating use case is to propagate `dso_local`
attribute of global variables across modules, to optimize global
variable access when a binary is built with
`-fno-direct-access-external-data`.
* With `-fdirect-access-external-data`, non thread-local global
variables will [have `dso_local`
attributes](https://github.com/llvm/llvm-project/blob/fe3c23b439b9a2d00442d9bc6a4ca86f73066a3d/clang/lib/CodeGen/CodeGenModule.cpp#L1730-L1746).
This optimizes the global variable access as shown by
https://gcc.godbolt.org/z/vMzWcKdh3



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