[Mlir-commits] [mlir] [mlir][arith] Add more canonicalization and integration tests coverage (PR #92272)

Jacob Yu llvmlistbot at llvm.org
Sat Aug 31 23:16:51 PDT 2024


pingshiyu wrote:

> Why isn't it the case for a canonicalization pattern?

You're right, unit tests don't test the correctness of any patterns - but integration tests would.

Pattern correctness can also be a problem for canonicalization patterns, I remember quite a few bugs due to incorrect canonicalizers. 

But lowerings are easier to test in an integration test - it's easy to control when they're applied and they're applied in isolation. 

OTOH multiple canonicalization patterns may apply and are also applied greedily, so IMO it's harder to isolate them and write integration tests for (correct me if I'm wrong!). 

> Also what is different between LLVM instruction selection and a MLIR lowering pattern?

I'm not very familiar with how they're tested so I cannot compare the two, sorry!

https://github.com/llvm/llvm-project/pull/92272


More information about the Mlir-commits mailing list