commit | 3d05721dd2696ece6d2393146bcb5d11d905d383 | [log] [tgz] |
---|---|---|
author | Matthias Springer <me@m-sp.org> | Fri Sep 12 15:28:02 2025 +0100 |
committer | Copybara-Service <copybara-worker@google.com> | Fri Sep 12 07:31:26 2025 -0700 |
tree | c6d29ccd5e2c90cedb7a03fbd5ea5bfe00caab0e | |
parent | 841db680884e0132a92b30d4b50171a75e4ee19f [diff] |
[mlir][Transforms] Fix crash in `reconcile-unrealized-casts` (#158298) The `reconcile-unrealized-casts` pass used to crash when the input contains circular chains of `unrealized_conversion_cast` ops. Furthermore, the `reconcileUnrealizedCasts` helper functions used to erase ops that were not passed via the `castOps` operand. Such ops are now preserved. That's why some integration tests had to be changed. Also avoid copying the set of all unresolved materializations in `convertOperations`. This commit is in preparation of turning `RewriterBase::replaceOp` into a non-virtual function. This is a re-upload of #158067, which was reverted due to CI failures. Note for LLVM integration: If you are seeing tests that are failing with `error: LLVM Translation failed for operation: builtin.unrealized_conversion_cast`, you may have to add the `-reconcile-unrealized-casts` pass to your pass pipeline. (Or switch to the `-convert-to-llvm` pass instead of combining the various `-convert-*-to-llvm` passes.) --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com> GitOrigin-RevId: da82d72a3dd986b90b179fda142114b540243213
See https://mlir.llvm.org/ for more information.