[Mlir-commits] [mlir] [mlir][arith] Check for valid IR in BitcastOp::fold. (PR #100743)

Ingo Müller llvmlistbot at llvm.org
Fri Jul 26 08:18:59 PDT 2024


ingomueller-net wrote:

> Why wouldn't we fix the pattern instead?

Yes, absolutely! Even with the current state of the PR, my pattern would create invalid IR, but instead of crashing, verification would fail.

I take it that folders can generally assume that they work on valid IR, right? Then the current behavior of the folder (before this PR) is actually fine.

What we might still be able to improve is to help finding the root cause easier when a pattern is broken, like mine. Then `BitcastOp::fold` could *assert* that the types are cast compatible, with a message that says that the input IR is broken. Would that be helpful?



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


More information about the Mlir-commits mailing list