[PATCH] D98577: [InlineCost] Compute the savings of switch statements and SROA in the cost benefit analysis

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 16:24:51 PDT 2021


kazu added a comment.

Do you think you could try some benchmarks?

I personally tried to take into account SROA, switch statements, and even DCE of instructions used to compute unused return values.  None of these has resulted in measurable performance differences.  When I look at savings, the call overhead usually dominates the savings.  My understanding is that we always inline the most desirable call sites if we assume that the ratio of savings to cost is a reasonable indicator of desirability.  Attempts to compute savings more accurately just moves the cutoff point in the long tail of call sites, without impacting the set of critically important call sites.

That said, if you have compelling numbers or simply want to take care of the TODO items, I'm happy to LGTM this patch.  I'd be just as happy if you simply remove the TODO comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98577



More information about the llvm-commits mailing list