[AlwaysInliner] Emit inline remark only when successful
authorEllis Hoag <ellis.sparky.hoag@gmail.com>
Thu, 17 Mar 2022 20:00:27 +0000 (13:00 -0700)
committerEllis Hoag <ellis.sparky.hoag@gmail.com>
Thu, 17 Mar 2022 22:40:24 +0000 (15:40 -0700)
commitf6b5142ac2e4c49b9eff4c22d699f464a6812feb
treeefc263a15dfae6fd86d323777c2cedbd945408a9
parent187a5f230f4b5d6602cfce163e7376426c31a9f2
[AlwaysInliner] Emit inline remark only when successful

Failures in `InlineFunction()` are caught after D121722, but `emitInlinedIntoBasedOnCost()` should only be called when inlining is successful. This also removes an unnecessary call to `shouldInline()` which always returned `InlineCost::getAlways()`.

Reviewed By: kyulee, nikic

Differential Revision: https://reviews.llvm.org/D121946
llvm/lib/Transforms/IPO/AlwaysInliner.cpp
llvm/test/Transforms/Inline/always-inline-remark.ll