[all-commits] [llvm/llvm-project] 53adfa: [clang] Do not duplicate "EnableSplitLTOUnit" modu...

David Greene via All-commits all-commits at lists.llvm.org
Thu Dec 2 08:25:14 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53adfa8750eaf4558c41a50f699616545eb0151b
  Author: David Greene <david.greene at cerebras.net>
  Date:   2021-12-02 (Thu, 02 Dec 2021)

  Changed paths:
    M clang/lib/CodeGen/BackendUtil.cpp
    A clang/test/CodeGen/enable-split-lto-unit.ll

  Log Message:
  [clang] Do not duplicate "EnableSplitLTOUnit" module flag

If clang's output is set to bitcode and LTO is enabled, clang would
unconditionally add the flag to the module.  Unfortunately, if the input were a
bitcode or IR file and had the flag set, this would result in two copies of the
flag, which is illegal IR.  Guard the setting of the flag by checking whether it
already exists.  This follows existing practice for the related "ThinLTO" module

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

More information about the All-commits mailing list