Add lowering for cases where the reduction dimension is fully unrolled.
It is common to unroll the reduction dimension, therefore we would want
to lower the contractions to an elementwise vector op in this case.
Details
Diff Detail
Event Timeline
Nice, thanks for this, Thomas!
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
169 | This need to check the acc's type is a vector type. Otherwise we might generate vector.fma with scalar types, which is invalid. | |
186 | Could use isReductionIterator over Attribute directly here? | |
204 | Nit: using else to wrap L206 might read better. | |
637 | Can use llvm::concat to loop over lhsReductionDims and rhsReductionDims together? | |
658 | Nice stuff with vector.extract and vector.broadcast! :D |
This need to check the acc's type is a vector type. Otherwise we might generate vector.fma with scalar types, which is invalid.