[PATCH] D115545: [Inline] Attempt to delete any discardable if unused functions

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 12 08:29:54 PST 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:967
+          } else {
+            DeadFunctionsInComdats.push_back(&Callee);
+          }
----------------
mtrofin wrote:
> can you make `Advice->recordInliningWithCalleeDeleted` happen in this case, too?
I'm not sure that would be the right modelling. I believe the reasoning here is that even if we drop a linkonce_odr function in this module, there may be many other modules that also define the same function. It will only be really deleted if it is deleted from *all* modules. Otherwise dropping it in just one module has no effect after linking. I think this is why the inlining cost model does not apply the last call to local to linkonce_odr functions. And I would expect that the advisor would follow similar reasoning.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115545



More information about the llvm-commits mailing list