This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Affine] Make fusion helper check method significantly more efficient
ClosedPublic

Authored by bondhugula on Dec 21 2022, 5:46 PM.

Details

Summary

The hasDependencePath method in affine fusion is quite inefficient as
it does a DFS on the complete graph for what is a small part of the
checks before fusion can be performed. Make this efficient by using the
fact that the nodes involved are all at the top-level of the same block.
With this change, for large graphs with about 10,000 nodes, the check
runs in a few seconds instead of not terminating even in a few hours.

This is NFC from a functionality standpoint; it only leads to an
improvement in pass running time on large IR.

Diff Detail

Event Timeline

bondhugula created this revision.Dec 21 2022, 5:46 PM
bondhugula requested review of this revision.Dec 21 2022, 5:46 PM

Thanks - this helps. LGTM!

This revision is now accepted and ready to land.Dec 25 2022, 8:21 PM