23struct PyMlirTransformOptions {
25 PyMlirTransformOptions(PyMlirTransformOptions &&other) {
27 other.options.ptr =
nullptr;
29 PyMlirTransformOptions(
const PyMlirTransformOptions &) =
delete;
38 nb::class_<PyMlirTransformOptions>(m,
"TransformOptions")
42 [](
const PyMlirTransformOptions &self) {
45 [](PyMlirTransformOptions &self,
bool value) {
49 "enforce_single_top_level_transform_op",
50 [](
const PyMlirTransformOptions &self) {
54 [](PyMlirTransformOptions &self,
bool value) {
60 "apply_named_sequence",
61 [](MlirOperation payloadRoot, MlirOperation transformRoot,
62 MlirOperation transformModule,
const PyMlirTransformOptions &
options) {
69 nb::object obj = nb::cast(payloadRoot);
72 payloadRoot, transformRoot, transformModule,
options.options);
76 throw nb::value_error(
77 (
"Failed to apply named transform sequence.\nDiagnostic message " +
81 nb::arg(
"payload_root"), nb::arg(
"transform_root"),
82 nb::arg(
"transform_module"),
83 nb::arg(
"transform_options") = PyMlirTransformOptions());
86 "copy_symbols_and_merge_into",
87 [](MlirOperation
target, MlirOperation other) {
93 throw nb::value_error(
94 (
"Failed to merge symbols.\nDiagnostic message " +
99 nb::arg(
"target"), nb::arg(
"other"));
103 m.doc() =
"MLIR Transform dialect interpreter functionality.";
MlirContext mlirOperationGetContext(MlirOperation op)
MLIR_CAPI_EXPORTED MlirLogicalResult mlirTransformApplyNamedSequence(MlirOperation payload, MlirOperation transformRoot, MlirOperation transformModule, MlirTransformOptions transformOptions)
Applies the transformation script starting at the given transform root operation to the given payload...
MLIR_CAPI_EXPORTED bool mlirTransformOptionsGetEnforceSingleTopLevelTransformOp(MlirTransformOptions transformOptions)
Returns true if the enforcement of the top-level transform op being single is enabled in transform op...
MLIR_CAPI_EXPORTED void mlirTransformOptionsEnableExpensiveChecks(MlirTransformOptions transformOptions, bool enable)
Enables or disables expensive checks in transform options.
MLIR_CAPI_EXPORTED void mlirTransformOptionsDestroy(MlirTransformOptions transformOptions)
Destroys a transform options object previously created by mlirTransformOptionsCreate.
MLIR_CAPI_EXPORTED void mlirTransformOptionsEnforceSingleTopLevelTransformOp(MlirTransformOptions transformOptions, bool enable)
Enables or disables the enforcement of the top-level transform op being single in transform options.
MLIR_CAPI_EXPORTED MlirTransformOptions mlirTransformOptionsCreate(void)
Creates a default-initialized transform options object.
MLIR_CAPI_EXPORTED MlirLogicalResult mlirMergeSymbolsIntoFromClone(MlirOperation target, MlirOperation other)
Merge the symbols from other into target, potentially renaming them to avoid conflicts.
MLIR_CAPI_EXPORTED bool mlirTransformOptionsGetExpensiveChecksEnabled(MlirTransformOptions transformOptions)
Returns true if expensive checks are enabled in transform options.
static llvm::ManagedStatic< PassManagerOptions > options
RAII scope intercepting all diagnostics into a string.
std::string takeMessage()
static bool mlirLogicalResultIsSuccess(MlirLogicalResult res)
Checks if the given logical result represents a success.
static bool mlirLogicalResultIsFailure(MlirLogicalResult res)
Checks if the given logical result represents a failure.
A logical result value, essentially a boolean with named states.