Make sure that we can fuse diamond shaped graphs.
We have some logic which does a global analysis of the graph to determine if we want to allow duplication of specific instructions. This logic however does not take into account whether actually duplication is needed because the analysis runs on the original graph and is not recomputed when nodes are fused. For the GPU and CPU backends, we run the fusion pass twice: once where we disallow *all* duplications, and once where we allow *some* duplications. The global analysis is therefore not needed if we disallow *all* duplications, and then we can successfully fuse diamond-shaped graphs because we do a reverse postorder traversal through the graph. PiperOrigin-RevId: 223961479
Loading
Please sign in to comment