Commit aed4356
[mlir][Transforms] Dialect Conversion: Add
This commit adds a new function
`ConversionPatternRewriter::replaceOpWithMultiple`. This function is
similar to `replaceOp`, but it accepts multiple `ValueRange`
replacements, one per op result.
Note: This function is not an overload of `replaceOp` because of
ambiguous overload resolution that would make the API difficult to use.
This commit aligns "block signature conversions" with "op replacements":
both support 1:N replacements now. Due to incomplete 1:N support in the
dialect conversion driver, an argument materialization is inserted when
an SSA value is replaced with multiple values; same as block signature
conversions already work around the problem. These argument
materializations are going to be removed in a subsequent commit that
adds full 1:N support. The purpose of this PR is to add missing features
gradually in small increments.
This commit also updates two MLIR transformations that have their custom
workarounds around missing 1:N support. These can already start using
`replaceOpWithMultiple`.
Co-authored-by: Markus Böck <[email protected]>replaceOpWithMultiple (llvm#115816)1 parent e5092c3 commit aed4356
File tree
5 files changed
+164
-99
lines changed- mlir
- include/mlir/Transforms
- lib
- Dialect
- Func/Transforms
- SparseTensor/Transforms
- Utils
- Transforms/Utils
5 files changed
+164
-99
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
798 | | - | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
799 | 803 | | |
800 | 804 | | |
801 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
802 | 810 | | |
803 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
804 | 824 | | |
805 | 825 | | |
806 | 826 | | |
| |||
Lines changed: 12 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 144 | + | |
| 145 | + | |
149 | 146 | | |
150 | | - | |
| 147 | + | |
151 | 148 | | |
152 | 149 | | |
153 | 150 | | |
154 | 151 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 152 | + | |
158 | 153 | | |
159 | 154 | | |
160 | 155 | | |
161 | 156 | | |
162 | 157 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 158 | + | |
| 159 | + | |
167 | 160 | | |
| 161 | + | |
168 | 162 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
183 | 167 | | |
184 | | - | |
| 168 | + | |
185 | 169 | | |
186 | 170 | | |
187 | 171 | | |
| |||
Lines changed: 20 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
604 | | - | |
| 603 | + | |
| 604 | + | |
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
625 | 624 | | |
626 | 625 | | |
627 | 626 | | |
628 | | - | |
| 627 | + | |
| 628 | + | |
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
635 | | - | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
636 | 637 | | |
637 | 638 | | |
638 | 639 | | |
| |||
776 | 777 | | |
777 | 778 | | |
778 | 779 | | |
779 | | - | |
| 780 | + | |
780 | 781 | | |
781 | 782 | | |
782 | 783 | | |
| |||
796 | 797 | | |
797 | 798 | | |
798 | 799 | | |
799 | | - | |
| 800 | + | |
800 | 801 | | |
801 | 802 | | |
802 | 803 | | |
| |||
837 | 838 | | |
838 | 839 | | |
839 | 840 | | |
840 | | - | |
| 841 | + | |
841 | 842 | | |
842 | 843 | | |
843 | 844 | | |
| |||
893 | 894 | | |
894 | 895 | | |
895 | 896 | | |
896 | | - | |
| 897 | + | |
897 | 898 | | |
898 | 899 | | |
899 | 900 | | |
| |||
1006 | 1007 | | |
1007 | 1008 | | |
1008 | 1009 | | |
1009 | | - | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
| 1017 | + | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| |||
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
1044 | | - | |
1045 | | - | |
| 1044 | + | |
1046 | 1045 | | |
1047 | 1046 | | |
1048 | 1047 | | |
| |||
1215 | 1214 | | |
1216 | 1215 | | |
1217 | 1216 | | |
1218 | | - | |
1219 | | - | |
| 1217 | + | |
1220 | 1218 | | |
1221 | 1219 | | |
1222 | 1220 | | |
| |||
1271 | 1269 | | |
1272 | 1270 | | |
1273 | 1271 | | |
1274 | | - | |
1275 | | - | |
| 1272 | + | |
1276 | 1273 | | |
1277 | 1274 | | |
1278 | 1275 | | |
| |||
1403 | 1400 | | |
1404 | 1401 | | |
1405 | 1402 | | |
1406 | | - | |
| 1403 | + | |
1407 | 1404 | | |
1408 | 1405 | | |
1409 | 1406 | | |
| |||
1577 | 1574 | | |
1578 | 1575 | | |
1579 | 1576 | | |
1580 | | - | |
| 1577 | + | |
1581 | 1578 | | |
1582 | 1579 | | |
1583 | 1580 | | |
| |||
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
57 | 66 | | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
0 commit comments