Files
clang-p2996/mlir/test/Dialect/Transform/transform-state-extension.mlir
Alex Zinenko 6c57b0debe [mlir] improve and test TransformState::Extension
Add the mechanism for TransformState extensions to update the mapping between
Transform IR values and Payload IR operations held by the state. The mechanism
is intentionally restrictive, similarly to how results of the transform op are
handled.

Introduce test ops that exercise a simple extension that maintains information
across the application of multiple transform ops.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D124778
2022-05-03 11:33:00 +02:00

47 lines
1.3 KiB
MLIR

// RUN: mlir-opt %s -test-transform-dialect-interpreter -verify-diagnostics -split-input-file
// expected-note @below {{associated payload op}}
module {
transform.sequence {
^bb0(%arg0: !pdl.operation):
// expected-remark @below {{extension absent}}
test_check_if_test_extension_present %arg0
test_add_test_extension "A"
// expected-remark @below {{extension present, A}}
test_check_if_test_extension_present %arg0
test_remove_test_extension
// expected-remark @below {{extension absent}}
test_check_if_test_extension_present %arg0
}
}
// -----
// expected-note @below {{associated payload op}}
module {
transform.sequence {
^bb0(%arg0: !pdl.operation):
test_add_test_extension "A"
test_remove_test_extension
test_add_test_extension "B"
// expected-remark @below {{extension present, B}}
test_check_if_test_extension_present %arg0
}
}
// -----
// expected-note @below {{associated payload op}}
module {
transform.sequence {
^bb0(%arg0: !pdl.operation):
test_add_test_extension "A"
// expected-remark @below {{extension present, A}}
test_check_if_test_extension_present %arg0
// expected-note @below {{associated payload op}}
test_remap_operand_to_self %arg0
// expected-remark @below {{extension present, A}}
test_check_if_test_extension_present %arg0
}
}