Commit 4b71bec
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 ef390b3 commit 4b71bec
1 file changed
+23
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1361 | 1361 | | |
1362 | 1362 | | |
1363 | 1363 | | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1364 | 1371 | | |
1365 | 1372 | | |
1366 | 1373 | | |
1367 | 1374 | | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1374 | 1379 | | |
1375 | 1380 | | |
1376 | 1381 | | |
1377 | 1382 | | |
1378 | 1383 | | |
1379 | 1384 | | |
1380 | 1385 | | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1381 | 1395 | | |
1382 | 1396 | | |
1383 | | - | |
1384 | | - | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1385 | 1400 | | |
1386 | 1401 | | |
1387 | 1402 | | |
| |||
0 commit comments