Commit 8582025
authored
[mlir][Transforms] Turn 1:N -> 1:1 dispatch fatal error into match failure (#153605)
Prior to this PR, the default behaviour of a conversion pattern which
receives operands of a 1:N is to abort the compilation. This has
historically been useful when the 1:N type conversion got merged into
the dialect conversion as it allowed us to easily find patterns that
should be capable of handling 1:N type conversions but didn't.
However, this behaviour has the disadvantage of being non-composable:
While the pattern in question cannot handle the 1:N type conversion,
another pattern part of the set might, but doesn't get the chance as
compilation is aborted.
This PR fixes this behaviour by failing to match and instead of
aborting, giving other patterns the chance to legalize an op. The
implementation uses a reusable function called `dispatchTo1To1` to allow
derived conversion patterns to also implement the behaviour.1 parent 6b16a27 commit 8582025
File tree
6 files changed
+99
-23
lines changed- flang/include/flang/Optimizer/CodeGen
- mlir
- include/mlir
- Conversion/LLVMCommon
- Transforms
- lib/Transforms/Utils
- test
- Transforms
- lib/Dialect/Test
6 files changed
+99
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
242 | | - | |
| 240 | + | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
| 246 | + | |
249 | 247 | | |
250 | 248 | | |
251 | 249 | | |
| |||
286 | 284 | | |
287 | 285 | | |
288 | 286 | | |
289 | | - | |
| 287 | + | |
290 | 288 | | |
291 | 289 | | |
292 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
525 | | - | |
| 524 | + | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | | - | |
| 537 | + | |
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
571 | | - | |
572 | | - | |
| 570 | + | |
| 571 | + | |
573 | 572 | | |
574 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
575 | 590 | | |
576 | 591 | | |
577 | 592 | | |
| |||
620 | 635 | | |
621 | 636 | | |
622 | 637 | | |
623 | | - | |
624 | | - | |
625 | | - | |
| 638 | + | |
626 | 639 | | |
627 | 640 | | |
628 | 641 | | |
| |||
666 | 679 | | |
667 | 680 | | |
668 | 681 | | |
669 | | - | |
| 682 | + | |
670 | 683 | | |
671 | 684 | | |
672 | 685 | | |
| |||
865 | 878 | | |
866 | 879 | | |
867 | 880 | | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
868 | 910 | | |
869 | 911 | | |
870 | 912 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2244 | 2244 | | |
2245 | 2245 | | |
2246 | 2246 | | |
2247 | | - | |
| 2247 | + | |
2248 | 2248 | | |
2249 | 2249 | | |
2250 | 2250 | | |
2251 | 2251 | | |
2252 | 2252 | | |
2253 | | - | |
2254 | | - | |
| 2253 | + | |
| 2254 | + | |
2255 | 2255 | | |
2256 | 2256 | | |
2257 | | - | |
| 2257 | + | |
2258 | 2258 | | |
2259 | 2259 | | |
2260 | 2260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1386 | 1386 | | |
1387 | 1387 | | |
1388 | 1388 | | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1389 | 1406 | | |
1390 | 1407 | | |
1391 | 1408 | | |
| |||
1497 | 1514 | | |
1498 | 1515 | | |
1499 | 1516 | | |
1500 | | - | |
1501 | | - | |
| 1517 | + | |
| 1518 | + | |
1502 | 1519 | | |
1503 | 1520 | | |
1504 | 1521 | | |
| |||
0 commit comments