How to debug code in Dialect/Affine/Transforms

Hi, I’m new to MLIR.

I was studying MLIR source code from llvm-project repository and I’m interested algorithms in MLIR affine transformations. I want to make some experimental changes on it and I’m trying to debug the code to strengthen my understandings. However, I couldn’t find any unit-test suite or use cases in the source code that uses transformations in Dialect/Affine/Transforms.

It seems basic testing can be done by using llvm-lit. However, it doesn’t allow me to debug or look inside how the code behaves precisely.

How can I debug the transformation code in Dialect/Affine/Transforms directory?

best regards

The test cases are in test/Dialect/Affine/. (Some like affine fusion are under test/Transforms/.)

LIT tests are the primary testing mechanism in LLVM and for a good reason: it is significantly easier to pattern-match textual IR than it is to write a robust corresponding unit test. See Testing Guide - MLIR.

If you want to understand what passes do internally, attach a debugger to mlir-opt.