This enables me to drop a custom vectorization pattern that we had in IREE and just use upstream linalg vectorization instead:
https://github.com/iree-org/iree/pull/9647
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1136 | seems this also works for parallel dims ? | |
1162 | Please use bool isFunctionOfDim(unsigned position) const to make close to a 1-liner | |
1170 | What corner case does this condition capture? If a dim is truly unused then we cannot give it an extent anyway and the op seems like it would be invalid? |
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1135 | you can replace this by broadcast.getVectorType() to avoid the cast |
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1141 | ||
1167 | nit: remove single line {: | |
1170 | The corner case is because vector.contract needs to have at least one reduction dim: | |
1183 | nit: remove single line {: |
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1136 | Yes, that's the point! Parallel dims are fine here, so we ignore them in this code which is checking for a potential bad case with reduction dims. | |
1170 | Thanks for the explanation Thomas, I added your testcase and added a rationale comment on the testcases. |
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | ||
---|---|---|
1136 | You are missing on level of indirection here, the iterator type associated to the dimension is based on the affine map. is should be contractOp.getIteratorTypes().getValue()[map.getDimPosition(i)). | |
1170 | nit: Might be worth a comment? |
you can replace this by broadcast.getVectorType() to avoid the cast