The hasNonAffineUsersOnPath utility used during fusion was terribly inefficient in its approach. Rewrite it efficiently to simply work based on use lists (sparse) instead of having to traverse all nodes of an MDG repeatedly and all operands of all ops of each node in the relevant range. On large models (with 10s of thousands of loop nests), this reduces fusion pass time by nearly 2x (cutting down several tens of seconds).
60 KiB
60 KiB