[PATCH] D104028: [WIP] Use standard priority queue to order inlining

Liqiang Tao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 01:35:40 PDT 2021


taolq added a comment.

In D104028#2818736 <https://reviews.llvm.org/D104028#2818736>, @ChuanqiXu wrote:

> I am tuning the performance by reordering inlining in downstream. My first try was to use std::priority_queue. But I tried to use the inline cost heuristic to order them. In this patch it looks like sort callsites by HistoryID? What's the intention?

Thanks for your comments. In this patch, callsites are sorted by callee size (see PriorityInlindeOrder::evaluate())

> BTW, for the performance side, SPEC2017 shows some regression with some improvement if we use std::priority_queue by InlineCost. It may be irrelevant to this patch.

That sounds great! I would like to use more elaborate priority functions in the future, e.g. consider both inline costs, callee size, and other profile.

> PS2: Did you consider to move InlineOrder(s) class out of Inlined.cpp into the header and make it as a member of InlinedPass just like the Advisor? I guess it may be more easier to use them.

It is defined in Inliner.cpp,  because it is an abstraction meant for the inliner.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104028



More information about the llvm-commits mailing list