I want to run a pass inside of a Transform dialect extension operation.
My pass is a conversion pass, and the dialect being converted to (my_target_dialect
) is listed as a “dependentDialect” of the pass. When I execute my transform IR using something like this:
// RUN: mlir-opt -test-transform-dialect-interpreter %s
... some IR...
transform.sequence failures(propagate) {
^bb1(%arg1: !pdl.operation):
%0 = transform.my_extension.run_conversion_pass %arg1
}
Then I get an error
LVM ERROR: Loading a dialect (my_target_dialect) while in a multi-threaded execution context
Stack trace indicates this is a result of the PassManager trying to load the pass’s dependent dialect my_target_dialect
.
Which is the right answer?
- Declare
my_target_dialect
as a dependent dialect of my source dialect - Declare
my_target_dialect
as a dependent dialect in my Transform op extension registration - Something else?
My understanding is that the first two options are not really for this purpose (but they do solve the problem). The transform dialect header here specifically says that (2) shouldn’t be used for this purpose.