Instruction Selection: Splitting instruction selection and scheduling


I’m currently working on an optimization pass, that requires the execution between instruction selection and scheduling. In addition, this pass is working on MachineFunction/Function level. Therefore it’s necessary, that the instruction selection for the whole Function is completed before any scheduling is done.

After the optimization pass had completed it’s work, the regular scheduling should start.

Is there a way to split those two phases and let the instruction selection complete for all basic blocks, before the scheduling starts?

A second question: Requires the instruction selection of a basic block the completion of scheduling of previous basic blocks?