The case being handled is when we are trying to form a bundle from a set of instructions where at least one is a transitive use of another existing tree node (i.e. has already been scheduled).
For context, the effect of bundling is effectively to add an extra scheduling dependency that all instructions within the bundle can be scheduled together. This means that all nodes making up the bundle will be scheduled at the point that *all* instructions making up the bundle are ready. This dependency is implicit and not explicitly materialized in the dependency sets.
The old code handled this by blowing away the entire schedule and all dependency information. This patch follows from the observations that a) bundling doesn't change (explicitly tracked) dependencies at all, and b) since we have a strictly bottom up scheduler the scheduling of users of the new bundle is not effected by the exact placement of the bundle instructions.
As such, we can parallel the upwards def walk that schedule does to remove dependencies, and unschedule only nodes reachable through the upwards def chain.
(For anyone aware of my MSSA patch, this change is completely unrelated - other than it cleans up some of the same code.)