Is subclass of ScheduleDAGMILive a pre-RA scheduler?

Hi All,

  The description of ScheduleDAGMILive [1] says:

    ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that
schedules machine instructions
    while updating LiveIntervals and tracking regpressure.

Does the live interval and register pressure part of ScheduleDAGMILive
mean the subclass of ScheduleDAGMILive
is a pre-RA scheduler? I assume the post-RA scheduler no need to take
care of live interval and register pressure,
since RA is done already.

Thanks.

[1] http://llvm.org/doxygen/classllvm_1_1ScheduleDAGMILive.html

Regards,
chenwj

Ping? :slight_smile:

Yes ScheduleDAGMILive is used by the MachineScheduler which runs before register allocation. By default the MachineScheduler is put between register coalescing and the greedy register allocator.

(There is also the PostMachineScheduler which as the name suggests runs after register allocation and that one only uses ScheduleDAGMI and does not track register pressure).

- Matthias

Hi, Matthias.

From the class hierarchy, ScheduleDAGMILive is also a ScheduleDAGMI. I

am wondering if there will be any problem if
we use subclass of ScheduleDAGMILive as post-RA scheduler? The best
case is ScheduleDAGMILive just waste time
on book-keeping register pressure, but I am not sure if we can still
do those book-keeping after RA.

Talk about post-RA scheduler, I see there is another class
PostRASchedulerList whose DEBUG_TYPE is post-RA-sched.
I am wondering if that means we have two post-RA schedulers in LLVM
right now? Any particular difference between those
two classes, PostMachineScheduler and PostRASchedulerList?

Thanks.

Regards,
chenwj

Hi, Matthias.

From the class hierarchy, ScheduleDAGMILive is also a ScheduleDAGMI. I
am wondering if there will be any problem if
we use subclass of ScheduleDAGMILive as post-RA scheduler? The best
case is ScheduleDAGMILive just waste time
on book-keeping register pressure, but I am not sure if we can still
do those book-keeping after RA.

Not sure why you want to use the variant with extra features that don't help you post-RA, but at least it shouldn't break.

Talk about post-RA scheduler, I see there is another class
PostRASchedulerList whose DEBUG_TYPE is post-RA-sched.
I am wondering if that means we have two post-RA schedulers in LLVM
right now? Any particular difference between those
two classes, PostMachineScheduler and PostRASchedulerList?

PostRASchedulerList is considered deprecated. If you are starting fresh use the PostMachineScheduler.

Hi, Matthias.

From the class hierarchy, ScheduleDAGMILive is also a ScheduleDAGMI. I
am wondering if there will be any problem if
we use subclass of ScheduleDAGMILive as post-RA scheduler? The best
case is ScheduleDAGMILive just waste time
on book-keeping register pressure, but I am not sure if we can still
do those book-keeping after RA.

Not sure why you want to use the variant with extra features that don't help you post-RA, but at least it shouldn't break.

Because I want to take other backends' MI scheduler as a template, it
seems all of them are pre-RA scheduler, so ...

If I want to do pre-RA and post-RA instruction scheduling, I assume I
can use ScheduleDAGMILive for both? Or you would
suggest pre-RA done by ScheduleDAGMILive, and post-RA done by
PostMachineScheduler?

Talk about post-RA scheduler, I see there is another class
PostRASchedulerList whose DEBUG_TYPE is post-RA-sched.
I am wondering if that means we have two post-RA schedulers in LLVM
right now? Any particular difference between those
two classes, PostMachineScheduler and PostRASchedulerList?

PostRASchedulerList is considered deprecated. If you are starting fresh use the PostMachineScheduler.

Is it possible to remove PostRASchedulerList, say, at LLVM 5.0? Or at
least mark it as deprecated somewhere?
For example, at the "The LLVM Target-Independent Code Generator" [1],
or at the header of the code. What do
you think?

Thanks.

[1] http://llvm.org/docs/CodeGenerator.html#selectiondag-scheduling-and-formation-phase

Regards,
chenwj