[PATCH] D69561: [ThinLTO] Import readonly vars with refs

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 06:17:37 PDT 2019


evgeny777 created this revision.
evgeny777 added reviewers: tejohnson, steven_wu.
Herald added subscribers: arphaman, dexonsmith, hiraditya, inglorion, mehdi_amini.

This patch allows importing readonly variables which have initializer referencing other functions or variables. Referenced functions (or vars) are promoted but not imported.

This allows two things to be done:

- Replacing indirect calls with direct calls to functions referenced in initializer
- Additional DCE with `-Wl,-mllvm,-function-sections -Wl,-mllvm,-data-sections, -Wl,--gc-sections` linker flags


https://reviews.llvm.org/D69561

Files:
  include/llvm/IR/ModuleSummaryIndex.h
  lib/Transforms/IPO/FunctionImport.cpp
  test/ThinLTO/X86/Inputs/indirect-call.ll
  test/ThinLTO/X86/indirect-call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69561.226884.patch
Type: text/x-patch
Size: 4271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191029/cd0fed5d/attachment.bin>


More information about the llvm-commits mailing list