[PATCH] D39869: [Inliner] Inline through indirect call sites having !callees metadata

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 12:57:27 PDT 2018


mssimpso updated this revision to Diff 141406.
mssimpso marked an inline comment as done.
mssimpso added a comment.

Addressed Easwaran's comments.

- Reused more code between the new and legacy pass managers.
- Ensured that promotion only happens when inlining is successful.

Thanks for your comments, Easwaran. This a fairly large update, primarily meant to address your concern that a promoted call site doesn't end up getting inlined. Ensuring this situation doesn't happen is somewhat difficult because the inlining algorithm itself can abort, even after the inline cost has been computed and inlining found to be profitable. The solution I've implemented here is to perform the promotion before the inline cost is computed (as in the previous version of the patch), but if inlining fails for any reason, the call site is demoted and made indirect again. So there shouldn't be any new direct calls in the program that weren't there before.


Repository:
  rL LLVM

https://reviews.llvm.org/D39869

Files:
  include/llvm/Transforms/Utils/CallPromotionUtils.h
  lib/Transforms/IPO/Inliner.cpp
  lib/Transforms/Utils/CallPromotionUtils.cpp
  test/Other/new-pm-defaults.ll
  test/Other/new-pm-thinlto-defaults.ll
  test/Transforms/Inline/callees-metadata.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39869.141406.patch
Type: text/x-patch
Size: 44423 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180406/f98e5e26/attachment-0001.bin>


More information about the llvm-commits mailing list