Commit 91b453b
committed
[mlir][tensor] Restrict the verifier for tensor.pack/tensor.unpack
Restricts the verifier for tensor.pack and tensor.unpack Ops so that the
following is no longer allowed:
```mlir
%c8 = arith.constant 8 : index
%0 = tensor.pack %input inner_dims_pos = [0, 1] inner_tiles = [8, %c8] into %output : tensor<?x?xf32> -> tensor<?x?x8x8xf32>
```
Specifically, in line with other Tensor Ops, require:
* a dynamic dimensions for each (dynamic) SSA value,
* a static dimension for each static size (attribute).
In the example above, a static dimension (8) is mixed with a dynamic
size (%c8).
Note that this is mostly deleting existing code - that's because this
change simplifies the logic in verifier.
For more context:
* https://discourse.llvm.org/t/tensor-ops-with-dynamic-sizes-which-behaviour-is-more-correct1 parent e13f1d1 commit 91b453b
File tree
2 files changed
+45
-14
lines changed- mlir
- lib/Dialect/Tensor/IR
- test/Dialect/Tensor
2 files changed
+45
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3865 | 3865 | | |
3866 | 3866 | | |
3867 | 3867 | | |
3868 | | - | |
3869 | | - | |
3870 | 3868 | | |
3871 | | - | |
3872 | | - | |
3873 | | - | |
3874 | | - | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
3875 | 3875 | | |
3876 | | - | |
3877 | | - | |
3878 | | - | |
3879 | | - | |
3880 | | - | |
3881 | | - | |
3882 | | - | |
3883 | | - | |
| 3876 | + | |
3884 | 3877 | | |
3885 | 3878 | | |
3886 | 3879 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
758 | 777 | | |
759 | 778 | | |
760 | 779 | | |
761 | 780 | | |
762 | 781 | | |
763 | 782 | | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
0 commit comments