[all-commits] [llvm/llvm-project] 476ca3: [LTO] Don't apply LTOPostLink module flag during w...

Steven Wu via All-commits all-commits at lists.llvm.org
Wed Aug 26 11:18:40 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 476ca330894bf42feeb6c13547d14c821f6b8e0a
      https://github.com/llvm/llvm-project/commit/476ca330894bf42feeb6c13547d14c821f6b8e0a
  Author: Steven Wu <stevenwu at apple.com>
  Date:   2020-08-26 (Wed, 26 Aug 2020)

  Changed paths:
    M llvm/lib/LTO/LTOCodeGenerator.cpp
    M llvm/test/LTO/ARM/lto-linking-metadata.ll
    M llvm/tools/llvm-lto/llvm-lto.cpp

  Log Message:
  -----------
  [LTO] Don't apply LTOPostLink module flag during writeMergedModule

For `ld64` which uses legacy LTOCodeGenerator, it relies on
writeMergedModule to perform `ld -r` (generates a linked object file).
If all the inputs to `ld -r` is fullLTO bitcode, `ld64` will linked the
bitcode module, internalize all the symbols and write out another
fullLTO bitcode object file. This bitcode file doesn't have all the
bitcode inputs and it should not have LTOPostLink module flag. It will
also cause error when this bitcode object file is linked with other LTO
object file.
Fix the issue by not applying LTOPostLink flag during writeMergedModule
function. The flag should only be added when all the bitcode are linked
and ready to be optimized.

rdar://problem/58462798

Reviewed By: tejohnson

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




More information about the All-commits mailing list