Commit 34b56da
committed
[mlir][vector] Prevent folding non memref-type gather into maskedload
This patch fixes an issue in the FoldContiguousGather pattern which was
incorrectly folding vector.gather operations with contiguous indices into
vector.maskedload operations regardless of the base operand type.
While vector.gather operations can work on both tensor and memref types,
vector.maskedload operations are only valid for memref types. The pattern
was incorrectly lowering a tensor-based gather into a masked-load, which
is invalid.
This fix adds a type check to ensure the pattern only applies to memref-based
gather operations.1 parent 04c3898 commit 34b56da
File tree
2 files changed
+16
-0
lines changed- mlir
- lib/Dialect/Vector/IR
- test/Dialect/Vector
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5340 | 5340 | | |
5341 | 5341 | | |
5342 | 5342 | | |
| 5343 | + | |
| 5344 | + | |
| 5345 | + | |
5343 | 5346 | | |
5344 | 5347 | | |
5345 | 5348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3149 | 3149 | | |
3150 | 3150 | | |
3151 | 3151 | | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
3152 | 3165 | | |
3153 | 3166 | | |
3154 | 3167 | | |
| |||
0 commit comments