[all-commits] [llvm/llvm-project] cfe1ec: [clang][llvm][fatlto] Avoid cloning modules in Fat...

Paul Kirth via All-commits all-commits at lists.llvm.org
Thu Nov 30 17:09:50 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cfe1ece833d643921da2735cd80e32b32ef170fb
      https://github.com/llvm/llvm-project/commit/cfe1ece833d643921da2735cd80e32b32ef170fb
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2023-11-30 (Thu, 30 Nov 2023)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/test/CodeGen/fat-lto-objects.c
    M clang/test/Driver/fat-lto-objects.c
    M llvm/docs/FatLTO.rst
    M llvm/include/llvm/Passes/PassBuilder.h
    M llvm/include/llvm/Transforms/IPO/EmbedBitcodePass.h
    M llvm/lib/Passes/PassBuilder.cpp
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/lib/Passes/PassRegistry.def
    M llvm/lib/Transforms/IPO/EmbedBitcodePass.cpp
    M llvm/test/CodeGen/X86/fat-lto-section.ll
    M llvm/test/Transforms/EmbedBitcode/embed.ll

  Log Message:
  -----------
  [clang][llvm][fatlto] Avoid cloning modules in FatLTO (#72180)

https://github.com/llvm/llvm-project/issues/70703 pointed out that
cloning LLVM modules could lead to miscompiles when using FatLTO.

This is due to an existing issue when cloning modules with labels (see
#55991 and #47769). Since this can lead to miscompilation, we can avoid
cloning the LLVM modules, which was desirable anyway.

This patch modifies the EmbedBitcodePass to no longer clone the module
or run an input pipeline over it. Further, it make FatLTO always perform
UnifiedLTO, so we can still defer the Thin/Full LTO decision to
link-time. Lastly, it removes dead/obsolete code related to now defunct
options that do not work with the EmbedBitcodePass implementation any
longer.




More information about the All-commits mailing list