Commit b42940d
committed
[mlir][Transforms] Dialect conversion: Extra checks during
This commit adds extra checks/assertions to the `ConversionPatternRewriterImpl::notifyOpReplaced` to improve its robustness.
Replacing an `unrealized_conversion_cast` op that was created by the driver is forbidden and is now caught early during `replaceOp`. It may work in some cases, but is generally dangerous because the conversion driver keeps track of these ops. (Erasing is them is fine.) This change is also in preparation of a subsequent commit that splits the `ConversionValueMapping` into replacements and materializations (with the goal of simplifying block signature conversions).
`null` replacement values are no longer registered in the `ConversionValueMapping`. This was an oversight in #106760. `null` values in the mapping could result in crashes when using the `ConversionValueMapping` API.replaceOp
1 parent 5621929 commit b42940d
1 file changed
+23
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1382 | 1382 | | |
1383 | 1383 | | |
1384 | 1384 | | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
1385 | 1392 | | |
1386 | 1393 | | |
1387 | 1394 | | |
1388 | 1395 | | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1395 | 1400 | | |
1396 | 1401 | | |
1397 | 1402 | | |
| |||
1400 | 1405 | | |
1401 | 1406 | | |
1402 | 1407 | | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1403 | 1417 | | |
1404 | 1418 | | |
1405 | | - | |
1406 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
1407 | 1422 | | |
1408 | 1423 | | |
1409 | 1424 | | |
| |||
0 commit comments