Add explicit tail calls to Clight and C#minor#422
Open
xavierleroy wants to merge 2 commits intomasterfrom
Open
Add explicit tail calls to Clight and C#minor#422xavierleroy wants to merge 2 commits intomasterfrom
xavierleroy wants to merge 2 commits intomasterfrom
Conversation
By popular demand. The tail call optimization pass performed later in CompCert will not turn a call into a tail call if the function has stack-allocated data, because this might change the semantics. Having an explicit Stailcall form in Clight makes it possible to force some calls in tail position to be tail calls, deallocating. deallocate stack-allocated data before the call. This is the same reason why we have an Stailcall form in Cminor already.
|
I would have thought that ExportClight.ml would also need to be edited, but I don't see that in the list of "files changed." |
Contributor
Author
|
My mistake. Will fix soon. |
Contributor
Author
|
Tentative fix pushed. |
Contributor
Author
|
Ping! Does this PR address the need? |
|
Yes, I'm pretty sure it does. I don't have time to test it this month. I recommend merge the P.R. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
By popular demand.
The tail call optimization pass performed later in CompCert will not turn a call into a tail call if the function has stack-allocated data, because this might change the semantics.
Having an explicit Stailcall form in Clight makes it possible to force a call in tail position to be a tail call, deallocating stack-allocated data before the call. This is the same reason why we have an Stailcall form in Cminor already.
Cc: @andrew-appel