[PATCH] D130012: [llvm][ModuleInliner] Add inline cost priority for module inliner

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 18 14:52:37 PDT 2022


kazu accepted this revision.
kazu added a comment.
This revision is now accepted and ready to land.

LGTM modulo some comments.  Thanks!



================
Comment at: llvm/lib/Analysis/InlineOrder.cpp:1
+#include "llvm/Analysis/InlineOrder.h"
+#include "llvm/Analysis/AssumptionCache.h"
----------------
Could you put the standard file header here?

```
//===- InlineOrder.cpp - Inlining order abstraction -*- C++ ---*-----------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===// 
```




================
Comment at: llvm/lib/Transforms/IPO/ModuleInliner.cpp:154-155
   // the SCC inliner, which need some refactoring.
   std::unique_ptr<InlineOrder<std::pair<CallBase *, int>>> Calls;
-  if (InlineEnablePriorityOrder)
-    Calls = std::make_unique<PriorityInlineOrder>(
-              std::make_unique<SizePriority>());
-  else
-    Calls = std::make_unique<DefaultInlineOrder<std::pair<CallBase *, int>>>();
+  Calls = getInlineOrder(UseInlinePriority, FAM, Params);
   assert(Calls != nullptr && "Expected an initialized InlineOrder");
----------------
I'd suggest:

```
auto Calls = getInlineOrder(UseInlinePriority, FAM, Params);
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130012



More information about the llvm-commits mailing list