[PATCH] D47652: [LowerTypeTests] Limit when which jumptable entries are emitted

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 13:56:47 PDT 2018


vlad.tsyrklevich created this revision.
vlad.tsyrklevich added reviewers: pcc, eugenis.
Herald added subscribers: llvm-commits, steven_wu, eraman, mehdi_amini, dschuff.
Herald added a reviewer: javed.absar.

Currently LowerTypeTests emits jumptable entries for all live external
and address-taken functions; however, we could limit the number of
functions that we emit entries for significantly.

For Cross-DSO CFI, we continue to emit jumptable entries for all
exported definitions.  In the non-Cross-DSO CFI case, we only need to
emit jumptable entries for live functions that are address-taken in live
functions. This ignores exported functions and functions that are only
address taken in dead functions. This change uses ThinLTO summary data
(now emitted for all modules during ThinLTO builds) to determine
address-taken and liveness info.

The logic for emitting jumptable entries is more conservative in the
regular LTO case because we don't have summary data in the case of
monolithic LTO builds; however, once summaries are emitted for all LTO
builds we can unify the Thin/monolithic LTO logic to only use summaries
to determine the liveness of address taking functions.

This change is a partial fix for PR37474. It reduces the build size for
nacl_helper by ~2-3%, the reduction is due to nacl_helper compiling in
lots of unused code and unused functions that are address taken in dead
functions no longer being being considered live due to emitted jumptable
references. The reduction for chromium is ~0.1-0.2%.


Repository:
  rL LLVM

https://reviews.llvm.org/D47652

Files:
  include/llvm/IR/ModuleSummaryIndexYAML.h
  lib/Transforms/IPO/LowerTypeTests.cpp
  test/LTO/Resolution/X86/export-jumptable.ll
  test/ThinLTO/X86/cfi-icall.ll
  test/Transforms/LowerTypeTests/Inputs/export-icall.yaml
  test/Transforms/LowerTypeTests/Inputs/exported-funcs.yaml
  test/Transforms/LowerTypeTests/export-alias.ll
  test/Transforms/LowerTypeTests/export-cross-dso-cfi.ll
  test/Transforms/LowerTypeTests/export-icall.ll
  test/Transforms/LowerTypeTests/export-symver.ll
  test/Transforms/LowerTypeTests/function-arm-thumb.ll
  test/Transforms/LowerTypeTests/function-ext.ll
  test/Transforms/LowerTypeTests/pr37625.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47652.149539.patch
Type: text/x-patch
Size: 18312 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180601/fc5a9670/attachment-0001.bin>


More information about the llvm-commits mailing list