Because glued nodes must be scheduled consecutively, glued User nodes
have an implicit ordering dependance to other predecessors of nodes
using their glue output. This fact is not captured in the topological
order constructed by AssignTopologicalOrder nor the precessor search
which uses this information to prune the search space, which results
in constructing cycles.
This patch fixes this by:
- Modifying the order construction to defer assigning an id to glue nodes until after all assignable non-glue nodes have been selected
- Having predecessor search explicitly search down a node's glue chain to find such indirect dependencies.