This helper handles non trivial cases of broadcast + optional transpose creation
that should not leak to the outside world.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td | ||
---|---|---|
459 | I think this should be a top-level method in VectorOps.h or VectorUtils.h because it it is more than just a BroadcastOp builder. | |
462 | const llvm::SetVector<int64_t> & | |
mlir/lib/Dialect/Vector/IR/VectorOps.cpp | ||
1718–1719 | I would move this comment to computeBroadcastedUnitDims. | |
1745–1747 | Should this be an assert? | |
1785 | nit: nextSrcShapeDim | |
mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp | ||
846–863 | I would walk the IR for unregistered ops like "test.create_broadcast"(%a) {broadcasted_dims = [2]} : (vector<3x4xf32>) -> (vector<3x4x5xf32>) instead of hardcoding these here. |
Address review.
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td | ||
---|---|---|
459 | true .. OTOH is is not a builder but a separate createOrFold method that is clearly documented and I really want people to find it rather than reinvent a broken wheel .. | |
mlir/lib/Dialect/Vector/IR/VectorOps.cpp | ||
1745–1747 | yes, I reworked a bunch of things around asserts to guarantee this creates or fold something. | |
mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp | ||
846–863 | fair enough, thanks! |
I think this should be a top-level method in VectorOps.h or VectorUtils.h because it it is more than just a BroadcastOp builder.