atrick added a comment. There's already a ScheduleDAGMutation interface for this purpose. The mutations are scheduled after ScheduDAGTopologicalSort so you can use that to avoid introducing cycles. Repository: rL LLVM http://reviews.llvm.org/D17868