Commit 357e380
[mlir][vector] Prevent folding non memref-type gather into maskedload (llvm#135371)
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.
Co-authored-by: Sagar Kulkarni <[email protected]>1 parent 54e70ac commit 357e380
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 | |
|---|---|---|---|
| |||
5348 | 5348 | | |
5349 | 5349 | | |
5350 | 5350 | | |
| 5351 | + | |
| 5352 | + | |
| 5353 | + | |
5351 | 5354 | | |
5352 | 5355 | | |
5353 | 5356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3198 | 3198 | | |
3199 | 3199 | | |
3200 | 3200 | | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
3201 | 3214 | | |
3202 | 3215 | | |
3203 | 3216 | | |
| |||
0 commit comments