Fix bug related to speculative inlining and data flow #3634
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 PR fixes a bug that can happen when loopifying a function, where during speculative inlining, data_flow would be run with call to the
self
continuation, but in a context whereself
is not known to data_flow (since we are only analyzing the inlined body, whereself
is not bound).The solution here is simply to not perform loopification of calls during speculative inlining. Note that once the inlining decision is made, when we rebuild the actual term, we still loopify as before, i.e. the patch only affects speculative inlining (where compilation currently fails, so we do not lose anything). Nevertheless, in the future, we may be interested in trying to count the benefit of the loopification.
Note: this is a 2 line-change (plus some comment for explanation), the rest is re-indentation, so reviewers are encouraged to use the ignore-whitespace-diff option.