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 | ||
---|---|---|
72 | 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). | |
82 | nit: Please remove user names from todos. | |
99 | nit: getDefiningOp<spirv::CompositeInsertOp>() |
mlir/lib/Dialect/SPIRV/Transforms/RewriteInsertsPass.cpp | ||
---|---|---|
72 | 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).