Add a pass to rewrite sequential chains of spirv::CompositeInsert
operations into spirv::CompositeConstruct operations.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This patch is related to https://github.com/tensorflow/mlir/issues/196, and the pass is based on https://github.com/google/clspv/blob/master/lib/RewriteInsertsPass.cpp
Comment Actions
Could this be conveyed as a simple canonicalization pattern on spv.CompositeInsert instead?
mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp | ||
---|---|---|
73 | How is this valid? The operation is required to be use_empty on destructure, otherwise it will assert. Seems like you want to iterate in reverse(llvm::reverse). | |
83 | nit: Please remove user names from todos. | |
100 | nit: getDefiningOp<spirv::CompositeInsertOp>() |
mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp | ||
---|---|---|
73 | Got your point, thanks. |
How is this valid? The operation is required to be use_empty on destructure, otherwise it will assert. Seems like you want to iterate in reverse(llvm::reverse).