llvm-project
d7857f97 - [mlir][Vector] Guard scalable reduction dim in matmul lowering (#226024)

Commit
4 days ago
[mlir][Vector] Guard scalable reduction dim in matmul lowering (#226024) `ContractionOpToMatmulOpLowering` previously rejected scalable `vector.contract` ops by checking only the result type. While this covers the M and N dimensions, it misses the K (reduction) dimension. For contractions with static M/N but a scalable K (e.g., `vector<2x[4]xf32>` times `vector<[4]x3xf32>`), the guard incorrectly passed. The pattern then attempted to build a flattened, non-scalable LHS/RHS type via `VectorType::get(lhsType.getNumElements(), ...)`, followed by a `vector.shape_cast`. This caused the `shape_cast` verifier to reject the conversion (source has a scalable dimension, result doesn't), crashing the pass instead of gracefully failing the match. Also check the LHS/RHS operand types for a scalable dimension, and add a regression test.
Author
Parents
Loading