This change breaks down LoopScheduling into two sub-passes: latency assignment and actual scheduling.
Latency assignment is a transformation that analyzes the loop and based on the requested number of stages it assigns "latencies" to the ops that are going to be converted to async ops by the pipeliner. Latencies are expressed in terms of number of iterations of the loop and can be thought as per-operation num_stages.
Scheduling transformation takes these latencies and builds a pipeliner schedule based on it. The process of building a schedule was slightly rewritten to simplify the code and cleanup the logic that was no longer needed after recent refactoring.
Breaking down the schedule into latency assignment and proper scheduling has number of purposes:
Code became more modular, with cleaner interfaces that helps with maintanance
Both parts can be tested in separation, I have added lit tests for both pieces. We can finally test our pipeliner infrastructure in manageable chunks
It opens up opportunity to expose per-op "latencies" to the frontend, enabling creating user-defined schedules right from the language level
Next step in the cleanup process is to clearly separate lowering and pipelining phases.
This change breaks down LoopScheduling into two sub-passes: latency assignment and actual scheduling. Latency assignment is a transformation that analyzes the loop and based on the requested number of stages it assigns "latencies" to the ops that are going to be converted to async ops by the pipeliner. Latencies are expressed in terms of number of iterations of the loop and can be thought as per-operation num_stages. Scheduling transformation takes these latencies and builds a pipeliner schedule based on it. The process of building a schedule was slightly rewritten to simplify the code and cleanup the logic that was no longer needed after recent refactoring. Breaking down the schedule into latency assignment and proper scheduling has number of purposes:
Next step in the cleanup process is to clearly separate lowering and pipelining phases.