[all-commits] [llvm/llvm-project] 54fb3c: [ThinLTO] Add Visibility bits to GlobalValueSummar...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Jan 27 10:52:32 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 54fb3ca96e261f7107cb1b5778c34cb0e0808be6
      https://github.com/llvm/llvm-project/commit/54fb3ca96e261f7107cb1b5778c34cb0e0808be6
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-01-27 (Wed, 27 Jan 2021)

  Changed paths:
    M llvm/include/llvm/IR/ModuleSummaryIndex.h
    M llvm/include/llvm/IR/ModuleSummaryIndexYAML.h
    M llvm/include/llvm/LTO/Config.h
    M llvm/include/llvm/LTO/LTO.h
    M llvm/include/llvm/Transforms/IPO/FunctionImport.h
    M llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
    M llvm/lib/AsmParser/LLLexer.cpp
    M llvm/lib/AsmParser/LLParser.cpp
    M llvm/lib/AsmParser/LLToken.h
    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/LTO/LTO.cpp
    M llvm/lib/LTO/ThinLTOCodeGenerator.cpp
    M llvm/lib/Transforms/IPO/FunctionImport.cpp
    M llvm/test/Assembler/multi-summary-disassemble.ll
    M llvm/test/Assembler/thinlto-multiple-summaries-for-guid.ll
    A llvm/test/Assembler/thinlto-summary-visibility.ll
    M llvm/test/Assembler/thinlto-summary.ll
    M llvm/test/Assembler/thinlto-vtable-summary.ll
    M llvm/test/Bitcode/thinlto-alias.ll
    M llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
    M llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll
    M llvm/test/Bitcode/thinlto-function-summary-refgraph.ll
    M llvm/test/Bitcode/thinlto-type-tests.ll
    M llvm/test/Bitcode/thinlto-type-vcalls.ll
    M llvm/test/ThinLTO/X86/funcimport_alwaysinline.ll
    M llvm/test/ThinLTO/X86/load-store-caching.ll
    M llvm/test/ThinLTO/X86/visibility-elf.ll
    M llvm/test/ThinLTO/X86/visibility-macho.ll
    M llvm/test/Transforms/LowerTypeTests/import-unsat.ll
    M llvm/test/Transforms/WholeProgramDevirt/import-indir.ll
    M llvm/test/tools/gold/X86/thinlto.ll

  Log Message:
  -----------
  [ThinLTO] Add Visibility bits to GlobalValueSummary::GVFlags

Imported functions and variable get the visibility from the module supplying the
definition.  However, non-imported definitions do not get the visibility from
(ELF) the most constraining visibility among all modules (Mach-O) the visibility
of the prevailing definition.

This patch

* adds visibility bits to GlobalValueSummary::GVFlags
* computes the result visibility and propagates it to all definitions

Protected/hidden can imply dso_local which can enable some optimizations (this
is stronger than GVFlags::DSOLocal because the implied dso_local can be
leveraged for ELF -shared while default visibility dso_local has to be cleared
for ELF -shared).

Note: we don't have summaries for declarations, so for ELF if a declaration has
the most constraining visibility, the result visibility may not be that one.

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




More information about the All-commits mailing list