Co-authored-by: Michal Terepeta <michalt@google.com>
Reviewed-by: nicolasvasilache
Paths
| Differential D115744
[mlir][Vector] Support 0-D vectors in ShuffleOp ClosedPublic Authored by nicolasvasilache on Dec 14 2021, 10:24 AM.
Details
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Aug 26 2022, 3:58 AM This revision now requires review to proceed.Aug 26 2022, 4:09 AM Comment Actions LGTM
This revision is now accepted and ready to land.Aug 26 2022, 10:10 AM Comment Actions The changes LGTM. Still trying to make my mind around the benefits of having a 0d vector vs canonicalizing it to a 1d vector or a scalar. I have the impression that having a 0d vector is the result of leaking high-level concepts that belong to frameworks into the lower level layers of the compiler. Anyways, this is not the place to discuss that.
Comment Actions Still trying to make my mind around the benefits of having a 0d vector vs canonicalizing it to a 1d vector or a scalar. I have the impression that having a 0d vector is the result of leaking high-level concepts that belong to frameworks into the lower level layers of the compiler. Anyways, this is not the place to discuss that. When they appear, it is quite unnatural to use either vector<1xf32> or f32; either of these decisions severely leak corner cases all around; vector<f32> is significantly better from that perspective. The merits of 0-d have also been discussed independently: https://discourse.llvm.org/t/should-we-have-0-d-vectors/3097 The concept to look out as a red flag of leaks from above for is shapes containing 0x in them; that is another discussion. nicolasvasilache added inline comments.
This revision was landed with ongoing or failed builds.Aug 29 2022, 12:40 AM Closed by commit rGdb6f8ebe066f: [mlir][Vector] Support 0-D vectors in ShuffleOp (authored by nicolasvasilache). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 456273 mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
mlir/test/Dialect/Vector/canonicalize.mlir
mlir/test/Dialect/Vector/invalid.mlir
mlir/test/Dialect/Vector/ops.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-0-d-vectors.mlir
|
Food for thoughts: Right now we don't allow mixing 0-D with 1-D, but I wonder if we should.
I am happy with limiting that for now. We can change this when/if the time comes.