This adds the ScheduleDAGMutation interface to the post-RA scheduler.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
There's already a ScheduleDAGMutation interface for this purpose. The mutations are scheduled after ScheduDAGTopologicalSort so you can use that to avoid introducing cycles.
That would work, but it only applies to MachineScheduler. For us this would need to be available for any scheduler (including post-RA scheduler and the packetizer).
Could move the interface from ScheduleDAGMI to ScheduleDAGInstrs?
Each scheduler should be able to run with its own set of DAG post processing mutations.
Can you just add the interface to the Packetizer and PostRA scheduler?
Also consider using MachineScheduler for postRA scheduling. It's been supported for a very long time now.
Also, the per-operand machine model allows for the definition of predicates that compute latencies contextually.
The post-RA scheduler runs as a standalone optimization. Targets do not create their own subclass of the scheduler, so there needs to be some other way of supplying DAG mutations. There is a subtarget hook to provide critical path register classes, so I guess I could one to provide mutations as well, but it would then be specific to the post-RA scheduler. Would that be ok?
In the long term we would probably replace the post-RA scheduler with a packetizing scheduler that does more than the current DFA packetizer.
Yeah. I'm saying that the hook *should* be specific to the old postRA scheduler. Each scheduler should have it's own capability for mutating the DAG. They can all share the ScheduleDAGMutation interface to allow reuse.