This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] LinalgOp-anchored empty tensor elimination
ClosedPublic

Authored by springerm on Jun 28 2023, 1:25 AM.

Details

Summary

This revision adds a pre-bufferization transform that can reduce the number of allocation. It is similar to bufferization.eliminate_empty_tensors, but specific to LinalgOp.

The transform looks for tensor.empty ops where the SSA use-def chain ends in an "ins" operand of a LinalgOp. If the same LinalgOp has an unused "outs" operand (and some other conditions are met), this "outs" operand can be used instead of the tensor.empty and the "ins" operand can be turned into an "outs" operand.

Diff Detail

Event Timeline

springerm created this revision.Jun 28 2023, 1:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2023, 1:25 AM
springerm requested review of this revision.Jun 28 2023, 1:25 AM
dcaballe accepted this revision.Jun 30 2023, 10:39 AM

Thanks! LGTM

This revision is now accepted and ready to land.Jun 30 2023, 10:39 AM