[PATCH] D25854: [lto] Kill undefined extern_weak declarations before opt

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 17:26:05 PDT 2016


eugenis created this revision.
eugenis added a reviewer: pcc.
eugenis added a subscriber: llvm-commits.
eugenis set the repository for this revision to rL LLVM.
Herald added a subscriber: mehdi_amini.

If an extern_weak declaration is resolved as undefined, RAUW it with
a null pointer and remove it from the module before running LTO
optimizations.

Besides the obvious codegen improvement, it allows CFI to avoid
generating jump tables for such functions (which can not be done
correctly, as a jump table entry can not be weak).


Repository:
  rL LLVM

https://reviews.llvm.org/D25854

Files:
  include/llvm/LTO/LTO.h
  lib/LTO/LTO.cpp
  test/LTO/Resolution/X86/weak.ll
  test/tools/gold/X86/comdat.ll
  test/tools/gold/X86/emit-llvm.ll
  test/tools/gold/X86/weak_undefined.ll
  tools/gold/gold-plugin.cpp
  tools/llvm-lto2/llvm-lto2.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25854.75376.patch
Type: text/x-patch
Size: 6597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161021/4f9ce4c5/attachment.bin>


More information about the llvm-commits mailing list