Commit 2983504
committed
[mlir][tosa] Fix select folder when operands are broadcast
This commit addresses a crash in the dialects folder.
The currently folder assumes no broadcasting of the
input operand happens and therefore the folder can
complain that the returned value was not the same
shape as the result.
For now, this commit ensures no folding happens when
broadcasting is involved. In the future, folding with a
broadcast could likely be supported by inserting a
`tosa.tile` operation before returning the operand. This
type of transformation is likely better suited for a
canonicalization pass. This commit only aims to avoid the
crash.
Change-Id: I2a3a21a3d2a626d4dd013219de7c37d6569779791 parent 986e0fe commit 2983504
File tree
2 files changed
+59
-0
lines changed- mlir
- lib/Dialect/Tosa/IR
- test/Dialect/Tosa
2 files changed
+59
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1484 | 1484 | | |
1485 | 1485 | | |
1486 | 1486 | | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
1487 | 1498 | | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
1488 | 1505 | | |
1489 | 1506 | | |
1490 | 1507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
646 | 688 | | |
647 | 689 | | |
648 | 690 | | |
| |||
0 commit comments