This commit adds extra checks/assertions to the `ConversionPatternRewriterImpl::notifyOpReplaced` to improve its robustness. 1. Replacing an `unrealized_conversion_cast` op that was created by the driver is now forbidden and caught early during `replaceOp`. It may work in some cases, but it is generally dangerous because the conversion driver keeps track of these ops and performs some extra legalization steps during the "finalize" phase. (Erasing is them is fine.) 2. `null` replacement values are no longer registered in the `ConversionValueMapping`. This was an oversight in #106760. There is no benefit in having `null` values in the `ConversionValueMapping`. (It may even cause problems.) This change is in preparation of merging the 1:1 and 1:N dialect conversion drivers.
128 KiB
128 KiB