mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 23:36:35 +00:00

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 <sagar@rain.ai>
Multi-Level Intermediate Representation
See https://mlir.llvm.org/ for more information.