Start converting LoopIR_scheduling to cursors architecture #311
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Converts the
_DoFuseLoop
Cursor_Rewrite class into a true cursor-based implementation. The diff is hard to read, so I'll paste the final code here:Note the important bit that models this edit as inserting the (substituted) body of the second loop to the end of the first loop, and then deletes the second loop altogether. This could perhaps be improved by using the following strategy:
Move
the body of the second loop to the end of the first loopreplace
the argument names where necessary(2) can be accomplished by making SubstArgs cursor-y.
Still TODO:
There's a bit of code clean-up here, too, to make this whole process saner:
LoopIR_Rewrite
no longer has an__init__
function or remembers the proc it was called on. This should really just be a visitor class and allow us to rewrite expressions or statements without the full context of a proc.SomeClass(...).result()
should be replaced bySomeFunction(...)
when there is no reason to separate setting up the task from running it.__all__
export mechanism in place of theSchedules
class.