util: DAG datastructure
I've written this DAG code so many times now, I decided to try to share it. It's not a ton of savings per user, but I think it does clean up the schedulers, and provides a nicer traverse than I had done before.
The motivation was nir-schedule, which I have also rebased on this branch.