Add basic canonicalization patterns for the extractMap/insertMap to allow them to be folded into Transfer ops.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Vector/VectorTransforms.cpp | ||
---|---|---|
2468 | It may be useful to add the map attribute to the ops and already here fail if the map is not 1-D minor identity or something. Do what you think is best :) | |
2469 | If you already pulled in EDSC for operator+ you might as well: vector_transfer_read(extract.getType() ...). | |
2491 | same comment re vector_transfer_write | |
mlir/test/Dialect/Vector/vector-distribution.mlir | ||
24 | vector_add_read_write_at_id ? Just trying to convey that this will only change 1 element in the vector. | |
mlir/test/lib/Transforms/TestVectorTransforms.cpp | ||
132 | For affine_apply ? Yet more evidence, affine_apply is a math dialect concept and not an "affine dialect" concept. | |
132 | s/math/arith |
mlir/lib/Dialect/Vector/VectorTransforms.cpp | ||
---|---|---|
2499 | just curious why you did not make this a regular folding optimization? |
mlir/lib/Dialect/Vector/VectorTransforms.cpp | ||
---|---|---|
2499 | (I think) Aart's point is that it could even be part of the op's folding mechanisms ? |
mlir/lib/Dialect/Vector/VectorTransforms.cpp | ||
---|---|---|
2499 | I believe Aart was talking about the case where ExtractMap's source comes from an insertMap and they cancel each other. I moved it to extractMap folder. This just removes both instruction so it seems like it belongs to the folder, the type of the source of insert has to map the return of extract by construction (since the multiplicty matches) %b = insertMap %a, %id, 32 extractMap %b, %id, 32 -> %a I'll push it like that. I can change it post-commit if you think this is needed. |
Yes, I am happy with this as folder, like you changed now. That looks much cleaner to me.
Revert marking TransferReadOp as readmem as some unit tests are not ready and have dead transfer_read
It may be useful to add the map attribute to the ops and already here fail if the map is not 1-D minor identity or something.
Problem is that the map is not yet designed so we are not 100% sure what form it will take.
Do what you think is best :)