[Mlir-commits] [mlir] [mlir][inliner] Add doClone and canHandleMultipleBlocks callbacks to Inliner (PR #131226)

Mehdi Amini llvmlistbot at llvm.org
Mon Mar 24 08:21:34 PDT 2025


================
@@ -90,18 +90,40 @@ class Inliner {
   /// this hook's interface might need to be extended in future.
   using ProfitabilityCallbackTy = std::function<bool(const ResolvedCall &)>;
 
+  /// Type of the callback that determines if the inliner can inline a function
+  /// containing multiple blocks into a region that requires a single block. By
+  /// default, it is not allowed.
+  /// If this function return true, the static member function doClone()
+  /// should perform the actual transformation with its support.
+  using canHandleMultipleBlocksCbTy = std::function<bool()>;
----------------
joker-eph wrote:

Should we just move this (and the doClone) to the `InlinerConfig` instead?
Let the user override the default callback in the config as needed.

(see below for the design issue with what you have right now).

https://github.com/llvm/llvm-project/pull/131226


More information about the Mlir-commits mailing list