[PATCH] D143624: Inlining: Run the legacy AlwaysInliner before the regular inliner.

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 11:27:28 PDT 2023


aeubanks added a comment.

In D143624#4315508 <https://reviews.llvm.org/D143624#4315508>, @nikic wrote:

> In D143624#4315468 <https://reviews.llvm.org/D143624#4315468>, @dmgreen wrote:
>
>> It looks like there is quite a lot more optimization that happens to the function being always-inlined (__SSAT) before this change. Through multiple rounds of instcombine, almost to the end of the pass pipeline. The new version runs a lot less before inlining, only running instcombine->simplifycfg and not seeing another instcombine to clean up the results. Is that because the AlwaysInlinePass is a module pass and it now only runs the passes up to that point?
>
> Yes, which is why I personally think this change isn't a good idea. This essentially breaks our invariant that functions get simplified before they are inlined. This significantly alters the way alwaysinline functions will be optimized relative to normally inlined functions.

That invariant shouldn't matter if we're not using heuristics to inline. The normal heuristic-based inliner will still work on simplified callees, but now with the additional benefit of seeing the state of an SCC where there may be alwaysinline calls after the inlinings that must happen having happened.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143624/new/

https://reviews.llvm.org/D143624



More information about the cfe-commits mailing list