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

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 14 10:21:53 PDT 2021


kazu added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:832
   // incrementally maknig a single function grow in a super linear fashion.
-  DefaultInlineOrder<std::pair<CallBase *, int>> Calls;
+  std::unique_ptr<InlineOrder<std::pair<CallBase *, int>>> CallsPtr(
+      new DefaultInlineOrder<std::pair<CallBase *, int>>());
----------------
mtrofin wrote:
> nit: when the flag is enabled, you end up allocating an object just to drop it right after. You can just allocate the appropriate one on each branch of the if statement. Then, if you want, just assert after the if that CallsPtr is not null - this will help maintaining this later, when there are more than 2 ordering implementations, and it makes the design crystal-clear.
nit: I would just leave the name as is -- "Calls".  "CallsPtr" is a bit mouthful although I understand what you mean here.


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