This patch extends the transfer drop unit dim patterns to support cases where the vector shape should also be reduced
(e.g., transfer_read(memref<1x4x1xf32>, vector<1x4x1xf32>) -> transfer_read(memref<4xf32>, vector<4xf32>).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Overall looks good to me, thanks! Just few nits.
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
---|---|---|
288 | I know that this is wrapped within anonymous namespace, so we don't need the static keyword. The style guide points out that we should use static keyword even if they are within anonymous namespace.
https://llvm.org/docs/CodingStandards.html#anonymous-namespaces | |
293–298 | ditto, add a static keyword. | |
349–358 | style nit: use auto. Because ::get method already spells the type. https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable |
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
---|---|---|
297 | Can you add a test to check when we have the vector shape <1x1x1xf32>? I ran into a problem in that case since the pass reduces them into zero-dim vectors. |
Landing. Thanks!
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
---|---|---|
288 | I think the doc means that we should move these cases out of the anonymous namespace and use static instead but not using both at the same time. Fixed! |
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
---|---|---|
297 | Sure, let me try |
mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | ||
---|---|---|
288 | Good point.. You're right! (My point was echoing the "scanning a big chunk of the file" point. And yes, it's not saying that we should use it at the same time.) |
I know that this is wrapped within anonymous namespace, so we don't need the static keyword. The style guide points out that we should use static keyword even if they are within anonymous namespace.
https://llvm.org/docs/CodingStandards.html#anonymous-namespaces