[PATCH] D91567: [llvm][inliner] Reuse the inliner pass to implement 'always inliner'

Mircea Trofin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 16 14:24:44 PST 2020


mtrofin created this revision.
mtrofin added reviewers: aeubanks, jdoerfert, davidxl, eraman.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya.
Herald added projects: clang, LLVM.
mtrofin requested review of this revision.

Enable performing mandatory inlinings upfront, by reusing the same logic
as the full inliner, instead of the AlwaysInliner. This has the
following benefits:

- reduce code duplication - one inliner codebase
- open the opportunity to help the full inliner by performing additional

function passes after the mandatory inlinings, but before th full
inliner. Performing the mandatory inlinings first simplifies the problem
the full inliner needs to solve: less call sites, more contextualization, and,
depending on the additional function optimization passes run between the
2 inliners, higher accuracy of cost models / decision policies.

Note that this patch does not yet enable much in terms of post-always
inline function optimization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91567

Files:
  clang/test/Frontend/optimization-remark-line-directive.c
  llvm/include/llvm/Analysis/InlineAdvisor.h
  llvm/include/llvm/Passes/PassBuilder.h
  llvm/lib/Analysis/InlineAdvisor.cpp
  llvm/lib/Analysis/MLInlineAdvisor.cpp
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/IPO/Inliner.cpp
  llvm/test/Transforms/Inline/ML/bounds-checks-rewards.ll
  llvm/test/Transforms/Inline/ML/bounds-checks.ll
  llvm/test/Transforms/Inline/inline_stats.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91567.305598.patch
Type: text/x-patch
Size: 17915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201116/6a08fc76/attachment-0001.bin>


More information about the cfe-commits mailing list