[all-commits] [llvm/llvm-project] 9a74c7: [ThinLTO][MC] Use conditional assignments for prom...

Sami Tolvanen via All-commits all-commits at lists.llvm.org
Fri Dec 10 12:34:03 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a74c753fe3fb40afeb0660060538678dd77d060
      https://github.com/llvm/llvm-project/commit/9a74c753fe3fb40afeb0660060538678dd77d060
  Author: Sami Tolvanen <samitolvanen at google.com>
  Date:   2021-12-10 (Fri, 10 Dec 2021)

  Changed paths:
    M llvm/include/llvm/MC/MCObjectStreamer.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
    A llvm/test/MC/ELF/lto-set-conditional.s
    A llvm/test/MC/MachO/lto-set-conditional.s
    M llvm/test/ThinLTO/X86/devirt2.ll
    M llvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll

  Log Message:
  -----------
  [ThinLTO][MC] Use conditional assignments for promotion aliases

Inline assembly refererences to static functions with ThinLTO+CFI were
fixed in D104058 by creating aliases for promoted functions. Creating
the aliases unconditionally resulted in an unexpected size increase in
a Chrome helper binary:

https://bugs.chromium.org/p/chromium/issues/detail?id=1261715

This is caused by the compiler being unable to drop unused code now
referenced by the alias in module-level inline assembly. This change
adds a .set_conditional assembly extension, which emits an assignment
only if the target symbol is also emitted, avoiding phantom references
to functions that could have otherwise been dropped.

This is an alternative to the solution proposed in D112761.

Reviewed By: pcc, nickdesaulniers, MaskRay

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




More information about the All-commits mailing list