[mlir] Vectorize directly to a named contraction in e2e tests
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Following #147296, we should try simplify our lowering pipelines for [e2e tests](https://github.com/llvm/llvm-project/tree/0d989b2aefe8d8f66981f1d39f56ce0214b5de86/mlir/test/Integration/Dialect/Linalg/CPU). Specifically,
* We should lower directly to named contractions, i.e. `vector.contract`, rather than via `vector.multi_reduction`.
Below are links to two examples. Specifically, lowering steps that we should be able to avoid if we lowered directly to `vector.contract`.
https://github.com/llvm/llvm-project/blob/0d989b2aefe8d8f66981f1d39f56ce0214b5de86/mlir/test/Integration/Dialect/Linalg/CPU/mmt4d.mlir#L82-L86
https://github.com/llvm/llvm-project/blob/0d989b2aefe8d8f66981f1d39f56ce0214b5de86/mlir/test/Integration/Dialect/Linalg/CPU/ArmSVE/matmul.mlir#L105-L111
Another example is being added here: https://github.com/llvm/llvm-project/pull/157815
Note, in order to enable lowering directly to `vector.contract`, update:
```mlir
transform.structured.vectorize %op_to_vectorize vector_sizes [...] : !transform.any_op
```
as
```mlir
transform.structured.vectorize %op_to_vectorize vector_sizes [...] {create_named_contraction} : !transform.any_op
```
Contributor guide
Assessment
This issue has not been assessed yet.