[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Hardening `replaceOp` (PR #109540)

Matthias Springer llvmlistbot at llvm.org
Mon Oct 28 18:47:12 PDT 2024


matthias-springer wrote:

> Trying to play devils advocate: How difficult would it be to support replacing unrealized casts as well? What about in the one-shot dialect conversion? Trying to think of this in terms of pattern rewrite API where in an ideal world the dialect conversion would not need any asterisks stating "well yes, it derives from`RewritePattern` and `RewriterBase` but its not an actual subtype as these specific things are not allowed".

The One-Shot Dialect Conversion will support it. (Because much less bookkeeping is necessary and most internal state will entirely disappear. The One-Shot driver will just look at the actual IR in most cases. And then it doesn't matter how we ended up with that IR.) It could even be supported in the current dialect conversion driver, but some internal state would have to be updated. I'm trying to keep the driver as simple as possible before the switch to One-Shot.

This change is mainly to help with debugging if something goes wrong in downstream projects during the migration. I plan to send a few more PRs that just assertions for unsupported API usage.

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


More information about the Mlir-commits mailing list