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

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

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

If the cycle number improves, go back to 1. to find the next candidate node.
I am thinking using SchedulePostRATDList’s topdown 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.