llvm-project/llvm/test/Transforms/Inline/module-inliner-basic.ll
Kazu Hirata 2d6ec146dd [ModuleInliner] Add MLPriority
This patch adds MLPriority as the first step toward the ML-based
function inlining with the module inliner.

For now, MLPriority is completely identical to CostPriority.

Once this patch lands, I'm planning to:

- integrate NoInferenceModelRunner,

- memoize the priority computation so that the priority remains the
  same for given values of metrics even with the noise injected during
  training, and

- port/take more features into account.

Differential Revision: https://reviews.llvm.org/D139140
2022-12-02 14:25:13 -08:00

22 lines
693 B
LLVM

; RUN: opt -passes=module-inline -S < %s | FileCheck %s
; RUN: opt -passes=module-inline -inline-priority-mode=size -S < %s | FileCheck %s
; RUN: opt -passes=module-inline -inline-priority-mode=cost -S < %s | FileCheck %s
; RUN: opt -passes=module-inline -inline-priority-mode=cost-benefit -S < %s | FileCheck %s
; RUN: opt -passes=module-inline -inline-priority-mode=ml -S < %s | FileCheck %s
define i32 @callee(i32 %a) {
entry:
%add = add nsw i32 %a, 1
ret i32 %add
}
define i32 @caller(i32 %a) {
entry:
%call = call i32 @callee(i32 %a)
ret i32 %call
}
; CHECK-LABEL: @caller
; CHECK-NOT: call
; CHECK: ret