[all-commits] [llvm/llvm-project] 732f53: [RFC][mlir] Add profitability callback to the Inli...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Wed Mar 13 08:23:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 732f5368cdc297e83f8720fb13a8c848ff116ccf
      https://github.com/llvm/llvm-project/commit/732f5368cdc297e83f8720fb13a8c848ff116ccf
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    M mlir/include/mlir/Transforms/Inliner.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/InlinerPass.cpp
    M mlir/lib/Transforms/Utils/Inliner.cpp
    M mlir/test/Transforms/inlining-dump-default-pipeline.mlir
    A mlir/test/Transforms/inlining-threshold.mlir

  Log Message:
  -----------
  [RFC][mlir] Add profitability callback to the Inliner. (#84258)

Discussion at https://discourse.llvm.org/t/inliner-cost-model/2992

This change adds a callback that reports whether inlining
of the particular call site (communicated via ResolvedCall argument)
is profitable or not. The default MLIR inliner pass behavior
is unchanged, i.e. the callback always returns true.
This callback may be used to customize the inliner behavior
based on the target specifics (like target instructions costs),
profitability of the inlining for further optimizations
(e.g. if inlining may enable loop optimizations or scalar optimizations
due to object shape propagation), optimization levels (e.g. -Os inlining
may be quite different from -Ofast inlining), etc.

One of the questions is whether the ResolvedCall entity represents
enough of the context for the custom inlining models to come up with
the profitability decision. I think we can start with this and
extend it as necessary.

---------

Co-authored-by: Mehdi Amini <joker.eph at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list