This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
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.
This reverts #610 except with simpler, and much better tested code (which is to say, actual tests and tests which exposed bugs).
This adds more tests, for e.g. #633
This does not yet enable turning on all the optimizations + naming, as you have to be more careful about "irreducibles", which can change under some optimizations (namely, composing functions). But it is enough to remove the code duplication between StripNameNodes and the DagOptimizer which can do the same thing in a type-safe and general way.
I'd like to get this merged, then tackle keeping names correct under general optimizations, which I think is possible. This will dramatically simplify implementing platforms if we can successfully get the optimizations + names working correctly.
Of course, the names could control potentially optimizations (since named options can be options for optimizations), but we can deal with that down the line (probably, by passing the options into the dag optimizer).