Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMissed optimization opportunities #2
Comments
added a commit
that referenced
this issue
Aug 26, 2018
This comment has been minimized.
This comment has been minimized.
|
Should be good for now |
lukaslueg
closed this
Aug 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lukaslueg commentedAug 12, 2018
•
edited
The
foldcommontails-walker currently misses some opportunities as demonstrated here (the optionalmutshould be folded) and here (thepubshould be folded).The problem most likely is that the optimizer might produce a
Choiceof just one element, when it effectivly becomes aSequence. Since it can not "look into" aChoicewhen evaluating common tails, it misses out.The fix is probably to implement a simplifying pass that
Choiceof exactly one element intoSequenceSequenceof exactly one element into that elementSequencein aRepeatThere are situations where we do this manually now; get rid of them.
The result of the folding pass should be simplified before re-evaluating the current
Choicefor more opportunities. The overall result should also be simplified.