When folding A->B->C => A->C only accept A->C that is valid shape cast
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
---|---|---|
3645 | What if srcType.getShape() == resultType.getRank()? This case would assert right now. |
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
---|---|---|
3645 | if its the same rank, in order to be valid it will have to be the same type. so we want be executing this isValidShapeCast |
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
---|---|---|
3645 | But isValidShapeCast has assert(rankA < rankB); so we would just assert in this case? |
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
---|---|---|
3642 | How do we know that? Can't we have something like: %0 = vector.shape_cast %arg0 : vector<4x2x2xf32> to vector<8x2xf32> %1 = vector.shape_cast %0 : vector<8x2xf32> to vector<2x4x2xf32> |
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
---|---|---|
3642 | right, it will be always invalid. |
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
---|---|---|
3646 | nit: remove braces for simple single line if: | |
3649–3651 | Can you add a test for this case? |
mlir/lib/Dialect/Vector/VectorOps.cpp | ||
---|---|---|
3642 | Can you put this if/else logic under isValidShapeCast(typea, typeb) ? |
How do we know that? Can't we have something like: