[PATCH] D48670: [ThinLTO] Ensure we always select the same function copy to import

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 13:44:31 PDT 2018


tejohnson created this revision.
tejohnson added a reviewer: davidxl.
Herald added subscribers: inglorion, mehdi_amini.

This is an updated version of https://reviews.llvm.org/D35436, which was reverted due to a
mysterious bot failure that I didn't have a chance to debug at the time.
The bot failure seemed like a side effect, so it might no longer be
triggered or exist as the ThinLTO implementation has evolved since then.

This is needed to fix an assert using a debug clang with distributed
ThinLTO backends, which is expecting to only get a single copy of any
given global value to import, and we are occasionally picking multiple.

Original description:
Check if the first eligible callee is under the instruction threshold.
Checking this on the first eligible callee ensures that we don't end
up selecting different callees to import when we invoke this routine
with different thresholds due to reaching the callee via paths that
are shallower or hotter (when there are multiple copies, i.e. with
weak or linkonce linkage). We don't want to leave the decision of which
copy to import up to the backend.


Repository:
  rL LLVM

https://reviews.llvm.org/D48670

Files:
  lib/Transforms/IPO/FunctionImport.cpp
  test/Transforms/FunctionImport/Inputs/funcimport_resolved1.ll
  test/Transforms/FunctionImport/Inputs/funcimport_resolved2.ll
  test/Transforms/FunctionImport/funcimport_resolved.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48670.153168.patch
Type: text/x-patch
Size: 6090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180627/26190360/attachment.bin>


More information about the llvm-commits mailing list