Fix record-ref reduction in cp0 #421
Merged
+153
−12
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.
In expressions like
the current reduction was dropping the possible side effect expressions
in this case the
(newline)
.A complete example is
==>
2
instead of12
As a side note, running only two times the cp0 pass, it is not enough to reduce some expressions like
(mybox-val (make-mybox 2)))
. It is necessary to run cp0 three times. I don't know after expansions and inlining if this kind of pattern is common. I tried compiling with three times cp0 instead of two and the compilation time changes very little. Perhaps it could be useful to change the default.