Such ops are no-ops and are folded to their respective source/vector operand.
Depends On D101745
Paths
| Differential D101879
[mlir] Allow empty position in vector.insert and vector.extract ClosedPublic Authored by springerm on May 4 2021, 5:59 PM.
Details Summary Such ops are no-ops and are folded to their respective source/vector operand. Depends On D101745
Diff Detail
Event TimelineComment Actions You rely on the folder to remove this, but would you mind adding some safety in the lowering code to LLVM (so that we don't get llvm.insertvalue %arg0, %arg1[] which will crash during lowering to LLVM IR)
springerm added a child revision: D101981: [mlir] Unrolled progressive-vector-to-scf..May 6 2021, 1:59 AM Comment Actions
I'd avoid relying on the folder having to run beforehand. Comment Actions
Exactly. Either not rewriting or sipmly dropping to source (as the folder does) in the rewriting is exactly the kind of safety I had in mind. Comment Actions
Done. Btw, this commit was necessary for an earlier design of the ProgressiveVectorToSCF lowering. It's not needed in the current design anymore. I thought it may be useful to keep the commit anyway, to make the op more general, but if you think this doesn't really add anything, I can also abandon this commit. Comment Actions Let's keep it! I actually like having ops "generalize" to corner cases. Thanks for the change. This revision is now accepted and ready to land.May 11 2021, 10:05 AM Closed by commit rG864adf399e58: [mlir] Allow empty position in vector.insert and vector.extract (authored by springerm). · Explain WhyMay 12 2021, 8:55 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 344256 mlir/include/mlir/Dialect/Vector/VectorOps.td
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/lib/Dialect/Vector/VectorOps.cpp
mlir/test/Dialect/Vector/invalid.mlir
mlir/test/Dialect/Vector/ops.mlir
|
I think that form was used for the slightly longer folders. I would be perfectly okay inlining the two lines of code above in here. But if you like this style, I am okay with it too...