Improve SortOp canonicalization pattern to also drop unused results in buffer semantics
Request description
original issue: https://github.com/iree-org/iree/issues/20699
incomplete pr: https://github.com/iree-org/iree/pull/20827
What component(s) does this issue relate to?
Compiler
Additional context
No response
Will add more context soon
I think the difference between tensor version and memref version is that the memref version does not need to check the use of the corresponding result. Other checks are the same.
Why is it closed?
All operands are sorted together, not individually.
Is it because of the above definition, so we can't drop the memrefs?
Why is it closed?
Sorry that was a mistake, and yes, we should be able to drop an unused indices DPS operand as long as it is an input to a later instruction.