This is an archive of the discontinued LLVM Phabricator instance.

Add DAG mutation interface to the post-RA scheduler
ClosedPublic

Authored by kparzysz on Mar 3 2016, 2:24 PM.

Details

Summary

This adds the ScheduleDAGMutation interface to the post-RA scheduler.

Diff Detail

Repository
rL LLVM

Event Timeline

kparzysz updated this revision to Diff 49776.Mar 3 2016, 2:24 PM
kparzysz retitled this revision from to Allow target-specific postprocessing of the schedule DAG.
kparzysz updated this object.
kparzysz added reviewers: MatzeB, atrick.
kparzysz set the repository for this revision to rL LLVM.
kparzysz added a subscriber: llvm-commits.
atrick edited edge metadata.Mar 4 2016, 11:37 AM

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.

kparzysz updated this revision to Diff 49853.Mar 4 2016, 2:07 PM
kparzysz retitled this revision from Allow target-specific postprocessing of the schedule DAG to Add DAG mutation interface to the post-RA scheduler.
kparzysz updated this object.
kparzysz edited edge metadata.

Changed the approach as discussed earlier.

atrick accepted this revision.Mar 4 2016, 4:33 PM
atrick edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 4 2016, 4:33 PM
This revision was automatically updated to reflect the committed changes.