The block names are currently chosen in order of them being printed in the IR, including when printed as successors, which results in them having different orders to MLIR, where they are printed in the order they're in in the region.
It would be good to have near-0 effort when using tests from MLIR in xDSL, which is in conflict with inconsistencies in the textual format.
As noted in #5563, there's a simple mapping between the two in many cases:
// copied from mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-matcher.mlir
// basic block numbering is slightly different, the following perl one-liner gets us far:
// `perl -pe 's/\bbb(\d+)/"bb".($1==2 ? 0 : $1>2 ? $1-1 : $1)/ge'` (replace bb2 with bb0, and decrement all bb numbers > 2)
// The argument list of functions also contains an extra space in xDSL compared to MLIR.
This is due to the blocks being inserted by a lowering from regions usually, which apply similar logic. When changing the logic in xDSL to match MLIR, a similar script is likely useful to update the tests.
The block names are currently chosen in order of them being printed in the IR, including when printed as successors, which results in them having different orders to MLIR, where they are printed in the order they're in in the region.
It would be good to have near-0 effort when using tests from MLIR in xDSL, which is in conflict with inconsistencies in the textual format.
As noted in #5563, there's a simple mapping between the two in many cases:
This is due to the blocks being inserted by a lowering from regions usually, which apply similar logic. When changing the logic in xDSL to match MLIR, a similar script is likely useful to update the tests.