[Mlir-commits] [mlir] [MLIR][Transform] Allow stateInitializer and stateExporter for applyTransforms (PR #101186)
Amy Wang
llvmlistbot at llvm.org
Mon Sep 9 07:55:45 PDT 2024
================
@@ -131,11 +131,13 @@ class TransformOptions {
/// will be executed following the internal logic of the operation. It must
/// have the `PossibleTopLevelTransformOp` trait and not have any operands.
/// This function internally keeps track of the transformation state.
-LogicalResult
-applyTransforms(Operation *payloadRoot, TransformOpInterface transform,
- const RaggedArray<MappedValue> &extraMapping = {},
- const TransformOptions &options = TransformOptions(),
- bool enforceToplevelTransformOp = true);
+LogicalResult applyTransforms(
+ Operation *payloadRoot, TransformOpInterface transform,
+ const RaggedArray<MappedValue> &extraMapping = {},
+ const TransformOptions &options = TransformOptions(),
+ bool enforceToplevelTransformOp = true,
+ function_ref<void(TransformState &)> stateInitializer = nullptr,
+ function_ref<LogicalResult(TransformState &)> stateExporter = nullptr);
----------------
kaitingwang wrote:
Thanks for approving this PR! This suggestion makes a lot of sense and I tried it and worked nicely. Let me merge this PR as-is and I'll immediate raise another one to update the API.
https://github.com/llvm/llvm-project/pull/101186
More information about the Mlir-commits
mailing list