[PATCH] D110607: [Inliner] Attempt to inline calls to alwaysinline functions first

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 27 18:52:05 PDT 2021


aeubanks created this revision.
aeubanks added a reviewer: mtrofin.
Herald added subscribers: ormris, hiraditya, eraman.
aeubanks requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

For PR46945 we added an extra alwaysinline inliner pass that runs before
the normal inliner pass. This was to fix the issue where we have two
mutually recursive functions, one marked alwaysinline, but due to inline
ordering, the other function may have been inlined into the alwaysinline
function first, causing the alwaysinline function to not be inlined into
the other function.

Adding a whole new pass is quite a bit of work. Rather, we can just
choose to handle alwaysinline calls first before inlining normal calls.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110607

Files:
  clang/test/Frontend/optimization-remark-line-directive.c
  clang/test/Frontend/optimization-remark-new-pm.c
  clang/test/Frontend/optimization-remark-with-hotness-new-pm.c
  clang/test/Frontend/optimization-remark.c
  llvm/include/llvm/Analysis/InlineAdvisor.h
  llvm/include/llvm/Analysis/InlineOrder.h
  llvm/include/llvm/Transforms/IPO/Inliner.h
  llvm/lib/Analysis/InlineAdvisor.cpp
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassBuilderPipelines.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/IPO/Inliner.cpp
  llvm/test/Other/new-pm-print-pipeline.ll
  llvm/test/Transforms/Inline/inline_nossp.ll
  llvm/test/Transforms/Inline/inline_stats.ll
  llvm/test/Transforms/Inline/no-inline-line-tables.ll
  llvm/test/Transforms/Inline/optimization-remarks-with-hotness.ll
  llvm/test/Transforms/Inline/optimization-remarks.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110607.375456.patch
Type: text/x-patch
Size: 29575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210928/53df35d3/attachment-0001.bin>


More information about the cfe-commits mailing list