iree icon indicating copy to clipboard operation
iree copied to clipboard

Improve SortOp canonicalization pattern to also drop unused results in buffer semantics

Open Muzammiluddin-Syed-ECE opened this issue 7 months ago • 5 comments

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

Muzammiluddin-Syed-ECE avatar May 15 '25 23:05 Muzammiluddin-Syed-ECE

Will add more context soon

Muzammiluddin-Syed-ECE avatar May 15 '25 23:05 Muzammiluddin-Syed-ECE

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.

hanhanW avatar May 16 '25 21:05 hanhanW

Why is it closed?

hanhanW avatar Jun 05 '25 02:06 hanhanW

All operands are sorted together, not individually.

Is it because of the above definition, so we can't drop the memrefs?

hanhanW avatar Jun 05 '25 02:06 hanhanW

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.

Muzammiluddin-Syed-ECE avatar Jun 09 '25 05:06 Muzammiluddin-Syed-ECE