[all-commits] [llvm/llvm-project] 850d53: LTO: Decide upfront whether to use opaque/non-opaq...

Matthias Braun via All-commits all-commits at lists.llvm.org
Wed Jun 1 18:07:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 850d53a197f9ffbf5708b7bd795056335e81e9b7
      https://github.com/llvm/llvm-project/commit/850d53a197f9ffbf5708b7bd795056335e81e9b7
  Author: Matthias Braun <matze at braunis.de>
  Date:   2022-06-01 (Wed, 01 Jun 2022)

  Changed paths:
    M clang/lib/Driver/ToolChains/CommonArgs.cpp
    M clang/test/CodeGen/thinlto-inline-asm2.c
    M clang/test/Driver/arm-float-abi-lto.c
    A clang/test/Driver/lto-no-opaque-pointers.c
    A clang/test/Driver/lto-opaque-pointers.c
    M clang/test/Driver/memtag_lto.c
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/LTO.cpp
    M lld/ELF/Options.td
    M lld/test/ELF/lto/discard-value-names.ll
    M lld/test/ELF/lto/ltopasses-basic.ll
    M lld/test/ELF/lto/type-merge.ll
    M lld/test/ELF/lto/type-merge2.ll
    M lld/test/ELF/lto/wrap-unreferenced-before-codegen.test
    M llvm/docs/OpaquePointers.rst
    M llvm/include/llvm/LTO/Config.h
    M llvm/test/Analysis/StackSafetyAnalysis/ipa-alias.ll
    M llvm/test/Analysis/StackSafetyAnalysis/ipa.ll
    M llvm/test/LTO/Resolution/X86/alias-alias.ll
    M llvm/test/LTO/Resolution/X86/comdat.ll
    M llvm/test/LTO/Resolution/X86/ifunc2.ll
    M llvm/test/LTO/Resolution/X86/local-def-dllimport.ll
    A llvm/test/LTO/X86/Inputs/opaque-pointers.ll
    M llvm/test/LTO/X86/cfi_jt_aliases.ll
    A llvm/test/LTO/X86/mix-opaque-typed.ll
    M llvm/test/LTO/X86/type-mapping-bug4.ll
    M llvm/test/ThinLTO/X86/Inputs/import-constant.ll
    M llvm/test/ThinLTO/X86/cfi-devirt.ll
    M llvm/test/ThinLTO/X86/cfi-unsat.ll
    M llvm/test/ThinLTO/X86/devirt-after-icp.ll
    M llvm/test/ThinLTO/X86/devirt2.ll
    M llvm/test/ThinLTO/X86/devirt_check.ll
    M llvm/test/ThinLTO/X86/devirt_promote.ll
    M llvm/test/ThinLTO/X86/devirt_single_hybrid.ll
    M llvm/test/ThinLTO/X86/funcattrs-prop-unknown.ll
    M llvm/test/ThinLTO/X86/globals-import-blockaddr.ll
    M llvm/test/ThinLTO/X86/import-constant.ll
    M llvm/test/ThinLTO/X86/import-dsolocal.ll
    M llvm/test/ThinLTO/X86/index-const-prop-gvref-pie.ll
    M llvm/test/ThinLTO/X86/index-const-prop-gvref.ll
    M llvm/test/ThinLTO/X86/index-const-prop-linkage.ll
    M llvm/test/ThinLTO/X86/reference_non_importable.ll
    M llvm/test/ThinLTO/X86/weak_externals.ll
    M llvm/tools/gold/gold-plugin.cpp
    M llvm/tools/llvm-lto2/llvm-lto2.cpp

  Log Message:
  -----------
  LTO: Decide upfront whether to use opaque/non-opaque pointer types

LTO code may end up mixing bitcode files from various sources varying in
their use of opaque pointer types. The current strategy to decide
between opaque / typed pointers upon the first bitcode file loaded does
not work here, since we could be loading a non-opaque bitcode file first
and would then be unable to load any files with opaque pointer types
later.

So for LTO this:
- Adds an `lto::Config::OpaquePointer` option and enforces an upfront
  decision between the two modes.
- Adds `-opaque-pointers`/`-no-opaque-pointers` options to the gold
  plugin; disabled by default.
- `--opaque-pointers`/`--no-opaque-pointers` options with
  `-plugin-opt=-opaque-pointers`/`-plugin-opt=-no-opaque-pointers`
  aliases to lld; disabled by default.
- Adds an `-lto-opaque-pointers` option to the `llvm-lto2` tool.
- Changes the clang driver to pass `-plugin-opt=-opaque-pointers` to
  the linker in LTO modes when clang was configured with opaque
  pointers enabled by default.

This fixes https://github.com/llvm/llvm-project/issues/55377

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




More information about the All-commits mailing list