Commit 54e3f12
[mlir][Transforms] Dialect conversion: Erase materialized constants instead of rollback (llvm#136489)
When illegal (and not legalizable) constant operations are materialized
during a dialect conversion as part of op folding, these operations must
be deleted again. This used to be implemented via the rollback
mechanism. This commit switches the implementation to regular rewriter
API usage: simply delete the materialized constants with `eraseOp`.
This commit is in preparation of the One-Shot Dialect Conversion
refactoring, which will disallow IR rollbacks.
This commit also adds a new optional parameter to `OpBuilder::tryFold`
to get hold of the materialized constant ops.1 parent aecb210 commit 54e3f12
File tree
3 files changed
+22
-16
lines changed- mlir
- include/mlir/IR
- lib
- IR
- Transforms/Utils
3 files changed
+22
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
568 | 570 | | |
569 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
570 | 574 | | |
571 | 575 | | |
572 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| |||
528 | 529 | | |
529 | 530 | | |
530 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
531 | 536 | | |
532 | 537 | | |
533 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2090 | 2090 | | |
2091 | 2091 | | |
2092 | 2092 | | |
2093 | | - | |
2094 | | - | |
2095 | 2093 | | |
2096 | 2094 | | |
2097 | 2095 | | |
2098 | 2096 | | |
2099 | 2097 | | |
2100 | 2098 | | |
2101 | 2099 | | |
| 2100 | + | |
2102 | 2101 | | |
2103 | | - | |
| 2102 | + | |
2104 | 2103 | | |
2105 | 2104 | | |
2106 | 2105 | | |
| 2106 | + | |
2107 | 2107 | | |
2108 | 2108 | | |
2109 | 2109 | | |
2110 | 2110 | | |
2111 | 2111 | | |
2112 | 2112 | | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
2116 | | - | |
2117 | | - | |
2118 | | - | |
2119 | | - | |
| 2113 | + | |
| 2114 | + | |
2120 | 2115 | | |
2121 | 2116 | | |
2122 | | - | |
2123 | | - | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
2124 | 2121 | | |
2125 | 2122 | | |
2126 | 2123 | | |
| |||
0 commit comments