[llvm-dev] [Newbie Question] Compute a schedule region's scheduled cycles.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] [Newbie Question] Compute a schedule region's scheduled cycles.

Gerolf Hoflehner via llvm-dev

Hi All,

 

I am trying to construct a small optimization based on ScheduleDAGInstrs that does the following:

1.      Find candidate nodes in the DAG, and speculatively modify the node (nodes).

2.      After modification, try to compute the scheduled cycles of the region.

3.      If the cycle number improves, go back to 1. to find the next candidate node.

 

I am thinking using SchedulePostRATDList’s top-down algorithm to calculate the cycles needed for the region’s execution. However, it decomposes the schedule DAG while calculating the cycles --- In my case I want to keep the DAG so that we don’t need to construct it again in the following steps.

 

So my question is: is there a way (or API) to calculate the scheduled cycles needed for the region, without touching the DAG? Or is there a better way to do so in a ScheduleDAG? Did I missed something?

 

Thanks in advance. Much appreciated.


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [Newbie Question] Compute a schedule region's scheduled cycles.

Gerolf Hoflehner via llvm-dev
Not saying I am totally understand how thing works, but I think you're misleading
by the DAG in the class name ScheduleDAGInstrs. I only see MachineInstrs
there, no SDNode. And the comment of ScheduleDAGInstrs says,

  /// A ScheduleDAG for scheduling lists of MachineInstr.

One place mentioning DAG is relate to constructing the dependency of SUnit,
i.e., Value2SUsMap.

Regards,
chenwj



2017-06-09 23:34 GMT+08:00 Xunhao Li (Alan, CRC) via llvm-dev <[hidden email]>:

Hi All,

 

I am trying to construct a small optimization based on ScheduleDAGInstrs that does the following:

1.      Find candidate nodes in the DAG, and speculatively modify the node (nodes).

2.      After modification, try to compute the scheduled cycles of the region.

3.      If the cycle number improves, go back to 1. to find the next candidate node.

 

I am thinking using SchedulePostRATDList’s top-down algorithm to calculate the cycles needed for the region’s execution. However, it decomposes the schedule DAG while calculating the cycles --- In my case I want to keep the DAG so that we don’t need to construct it again in the following steps.

 

So my question is: is there a way (or API) to calculate the scheduled cycles needed for the region, without touching the DAG? Or is there a better way to do so in a ScheduleDAG? Did I missed something?

 

Thanks in advance. Much appreciated.


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [Newbie Question] Compute a schedule region's scheduled cycles.

Gerolf Hoflehner via llvm-dev
Also you might need to check use PostRASchedulerList or PostMachineScheduler,
PostRASchedulerList is considered deprecated as mentioned in [1].


HTH,
chenwj


2017-06-10 4:03 GMT+08:00 陳韋任 <[hidden email]>:
Not saying I am totally understand how thing works, but I think you're misleading
by the DAG in the class name ScheduleDAGInstrs. I only see MachineInstrs
there, no SDNode. And the comment of ScheduleDAGInstrs says,

  /// A ScheduleDAG for scheduling lists of MachineInstr.

One place mentioning DAG is relate to constructing the dependency of SUnit,
i.e., Value2SUsMap.

Regards,
chenwj



2017-06-09 23:34 GMT+08:00 Xunhao Li (Alan, CRC) via llvm-dev <[hidden email]>:

Hi All,

 

I am trying to construct a small optimization based on ScheduleDAGInstrs that does the following:

1.      Find candidate nodes in the DAG, and speculatively modify the node (nodes).

2.      After modification, try to compute the scheduled cycles of the region.

3.      If the cycle number improves, go back to 1. to find the next candidate node.

 

I am thinking using SchedulePostRATDList’s top-down algorithm to calculate the cycles needed for the region’s execution. However, it decomposes the schedule DAG while calculating the cycles --- In my case I want to keep the DAG so that we don’t need to construct it again in the following steps.

 

So my question is: is there a way (or API) to calculate the scheduled cycles needed for the region, without touching the DAG? Or is there a better way to do so in a ScheduleDAG? Did I missed something?

 

Thanks in advance. Much appreciated.


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj



--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [Newbie Question] Compute a schedule region's scheduled cycles.

Gerolf Hoflehner via llvm-dev
+Matthias.

2017-06-10 5:06 GMT+08:00 陳韋任 <[hidden email]>:
Also you might need to check use PostRASchedulerList or PostMachineScheduler,
PostRASchedulerList is considered deprecated as mentioned in [1].


HTH,
chenwj


2017-06-10 4:03 GMT+08:00 陳韋任 <[hidden email]>:
Not saying I am totally understand how thing works, but I think you're misleading
by the DAG in the class name ScheduleDAGInstrs. I only see MachineInstrs
there, no SDNode. And the comment of ScheduleDAGInstrs says,

  /// A ScheduleDAG for scheduling lists of MachineInstr.

One place mentioning DAG is relate to constructing the dependency of SUnit,
i.e., Value2SUsMap.

Regards,
chenwj



2017-06-09 23:34 GMT+08:00 Xunhao Li (Alan, CRC) via llvm-dev <[hidden email]>:

Hi All,

 

I am trying to construct a small optimization based on ScheduleDAGInstrs that does the following:

1.      Find candidate nodes in the DAG, and speculatively modify the node (nodes).

2.      After modification, try to compute the scheduled cycles of the region.

3.      If the cycle number improves, go back to 1. to find the next candidate node.

 

I am thinking using SchedulePostRATDList’s top-down algorithm to calculate the cycles needed for the region’s execution. However, it decomposes the schedule DAG while calculating the cycles --- In my case I want to keep the DAG so that we don’t need to construct it again in the following steps.

 

So my question is: is there a way (or API) to calculate the scheduled cycles needed for the region, without touching the DAG? Or is there a better way to do so in a ScheduleDAG? Did I missed something?

 

Thanks in advance. Much appreciated.


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj



--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj



--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] [Newbie Question] Compute a schedule region's scheduled cycles.

Gerolf Hoflehner via llvm-dev
- ScheduleDAGInstr is a structure used by the PostMachineScheduler and PostRASchedulerList, so that is fine
- I am not sure I understand your exact goals here. But it sounds like you may either want to write a new scheduler reusing ScheduleDAGInstrs would be good there, you may also look into the MachineTraceMetrics class which computes resources used on the critical path. This currently used to direct some peephole optimizations. Even if it doesn't answer the sort of queries you want to perform it may be an example to learn from on how to use the scheduling model directly.

- Matthias

On Jun 9, 2017, at 2:14 PM, 陳韋任 <[hidden email]> wrote:

+Matthias.

2017-06-10 5:06 GMT+08:00 陳韋任 <[hidden email]>:
Also you might need to check use PostRASchedulerList or PostMachineScheduler,
PostRASchedulerList is considered deprecated as mentioned in [1].


HTH,
chenwj


2017-06-10 4:03 GMT+08:00 陳韋任 <[hidden email]>:
Not saying I am totally understand how thing works, but I think you're misleading
by the DAG in the class name ScheduleDAGInstrs. I only see MachineInstrs
there, no SDNode. And the comment of ScheduleDAGInstrs says,

  /// A ScheduleDAG for scheduling lists of MachineInstr.

One place mentioning DAG is relate to constructing the dependency of SUnit,
i.e., Value2SUsMap.

Regards,
chenwj



2017-06-09 23:34 GMT+08:00 Xunhao Li (Alan, CRC) via llvm-dev <[hidden email]>:

Hi All,

 

I am trying to construct a small optimization based on ScheduleDAGInstrs that does the following:

1.      Find candidate nodes in the DAG, and speculatively modify the node (nodes).

2.      After modification, try to compute the scheduled cycles of the region.

3.      If the cycle number improves, go back to 1. to find the next candidate node.

 

I am thinking using SchedulePostRATDList’s top-down algorithm to calculate the cycles needed for the region’s execution. However, it decomposes the schedule DAG while calculating the cycles --- In my case I want to keep the DAG so that we don’t need to construct it again in the following steps. 

 

So my question is: is there a way (or API) to calculate the scheduled cycles needed for the region, without touching the DAG? Or is there a better way to do so in a ScheduleDAG? Did I missed something?

 

Thanks in advance. Much appreciated.


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




-- 
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj



-- 
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj



-- 
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev