If an input bbArg is not used, its corresponding input operand is removed. If there are duplicate input operands or input operands that are also used as output operands, the duplicate input operands are removed. Output operands are never modified.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Linalg/Transforms/EraseUnusedOperandsAndResults.cpp | ||
---|---|---|
401 | for (auto [x, y] : replacements) ? |
mlir/lib/Dialect/Linalg/Transforms/EraseUnusedOperandsAndResults.cpp | ||
---|---|---|
373 | This seems to be a duplicate of what the deduplicate operands does. I am not sure why it is done separately and not added to the existing patterns. Unless I am missing something could we revert this patch (or do a follow up fix) and see why the existing patterns doesn't cover this case. It should. |
mlir/lib/Dialect/Linalg/Transforms/EraseUnusedOperandsAndResults.cpp | ||
---|---|---|
373 | DeduplicateAndRemoveDeadOperandsAndResults removes duplicate inputs and duplicate outputs separately. A value that is both an input and an output is not considered a duplicate by this pattern. The way the pattern is written it seems difficult to support this. We needed a specific way of de-duplicating operands: Outputs should not be modified (because they are bufferization DPS destinations), but inputs that are also outputs can be removed. (Removing the outputs instead would not be desirable.) |
This seems to be a duplicate of what the deduplicate operands does. I am not sure why it is done separately and not added to the existing patterns. Unless I am missing something could we revert this patch (or do a follow up fix) and see why the existing patterns doesn't cover this case. It should.