This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Fix bug in the fusion on tensors index op handling.
ClosedPublic

Authored by gysit on May 5 2021, 1:24 AM.

Details

Summary

The old index op handling created the index operations used to replace the producer indices directly in the fused block and let them point back to the producer block. As a result, after fusion some index operations in the fuse block had back references to the old producer block resulting in illegal IR. The patch performs the index operation replacement in the producer block and then clones all operations to the fused block avoiding the aforementioned inconsistencies.

Diff Detail

Event Timeline

gysit created this revision.May 5 2021, 1:24 AM
gysit requested review of this revision.May 5 2021, 1:24 AM
pifon2a accepted this revision.May 5 2021, 1:53 AM

Thank you, Tobias!

This revision is now accepted and ready to land.May 5 2021, 1:53 AM
gysit updated this revision to Diff 343026.May 5 2021, 6:24 AM

Avoid modifying the producer block since it may be inlined into another consumer. The updated revision thus introduces the fused index operations directly in the fused block and uses the mapper to updated the index op references during cloning.

ThomasRaoux accepted this revision.May 5 2021, 6:48 AM