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

Mircea Trofin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 08:15:02 PDT 2023


mtrofin 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.

(Nitpicking just on the invariant part) Not sure if that's always the invariant, because we could be inlining a call site in a SCC where both caller and callee are in that same SCC.


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