Commit 521b5f2
committed
[mlir] [IR] Allow zero strides in StridedLayoutAttr
Disabling memrefs with a stride of 0 was intended to prevent internal aliasing,
but this does not address all cases : internal aliasing can still occur when
the stride is less than the shape.
On the other hand, a stride of 0 can be very useful in certain scenarios.
For example, in architectures that support multi-dimensional DMA, we can use
memref::copy with a stride of 0 to achieve a broadcast effect.
This commit removes the restriction that strides in memrefs cannot be 0.1 parent ab27253 commit 521b5f2
File tree
5 files changed
+2
-35
lines changed- mlir
- lib/IR
- test
- Dialect
- Affine
- MemRef
- IR
5 files changed
+2
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | 248 | | |
252 | 249 | | |
253 | 250 | | |
| |||
1815 | 1812 | | |
1816 | 1813 | | |
1817 | 1814 | | |
1818 | | - | |
1819 | 1815 | | |
1820 | 1816 | | |
1821 | 1817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
803 | 803 | | |
804 | 804 | | |
805 | 805 | | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | 806 | | |
821 | 807 | | |
822 | 808 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | 248 | | |
259 | 249 | | |
260 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 102 | | |
108 | 103 | | |
109 | 104 | | |
| |||
0 commit comments