-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canonicalize IR to disallow throwing GlobalRef in value position #36450
Merged
Conversation
This file contains 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
In anticipation of making the SSA IR more of an interface that packages can use to implement custom compiler transformation, I'd like to do some cleanup first. The is the first of the items on my list: Disallowing GlobalRef in value position if it could potentially throw (because the binding doesn't exist yet). This is done as part of SSA conversion, because we don't know whether a binding will exist during parsing/lowering and we don't modify the IR at all between lowering and the end of type inference, so doing it during SSA conversion is the first possible opportunity. The reason to do this is to simplify transformation passes that want to replace calls with sequences of other instructions. By moving those GlobalRef that could potentially throw into statement position, the order of argument evaluation does not matter (this isn't quite true yet due to static parameters, but I'd like to fix that in a separate commit). I think that's a desirable property to simplify the life os pass authors.
JeffBezanson
approved these changes
Jun 29, 2020
vtjnash
approved these changes
Jun 29, 2020
simeonschaub
pushed a commit
to simeonschaub/julia
that referenced
this pull request
Aug 11, 2020
…iaLang#36450) In anticipation of making the SSA IR more of an interface that packages can use to implement custom compiler transformation, I'd like to do some cleanup first. The is the first of the items on my list: Disallowing GlobalRef in value position if it could potentially throw (because the binding doesn't exist yet). This is done as part of SSA conversion, because we don't know whether a binding will exist during parsing/lowering and we don't modify the IR at all between lowering and the end of type inference, so doing it during SSA conversion is the first possible opportunity. The reason to do this is to simplify transformation passes that want to replace calls with sequences of other instructions. By moving those GlobalRef that could potentially throw into statement position, the order of argument evaluation does not matter (this isn't quite true yet due to static parameters, but I'd like to fix that in a separate commit). I think that's a desirable property to simplify the life os pass authors.
vtjnash
added a commit
that referenced
this pull request
Mar 2, 2021
Generally we assume parameters can be duplicated without seeing side-effects. That is not entirely true of mutable global and multi-threading. Refs: #36450
Keno
pushed a commit
that referenced
this pull request
Mar 3, 2021
KristofferC
pushed a commit
that referenced
this pull request
Mar 14, 2021
ElOceanografo
pushed a commit
to ElOceanografo/julia
that referenced
this pull request
May 4, 2021
…aLang#39893) Generally we assume parameters can be duplicated without seeing side-effects. That is not entirely true of mutable globals and multi-threading. Refs: JuliaLang#36450 Fixes: JuliaLang#39508
antoine-levitt
pushed a commit
to antoine-levitt/julia
that referenced
this pull request
May 9, 2021
…aLang#39893) Generally we assume parameters can be duplicated without seeing side-effects. That is not entirely true of mutable globals and multi-threading. Refs: JuliaLang#36450 Fixes: JuliaLang#39508
staticfloat
pushed a commit
that referenced
this pull request
Dec 23, 2022
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.
In anticipation of making the SSA IR more of an interface
that packages can use to implement custom compiler transformation,
I'd like to do some cleanup first. The is the first of the items
on my list: Disallowing GlobalRef in value position if it could
potentially throw (because the binding doesn't exist yet).
This is done as part of SSA conversion, because we don't know
whether a binding will exist during parsing/lowering and we
don't modify the IR at all between lowering and the end of
type inference, so doing it during SSA conversion is the first
possible opportunity.
The reason to do this is to simplify transformation passes that
want to replace calls with sequences of other instructions. By
moving those GlobalRef that could potentially throw into statement
position, the order of argument evaluation does not matter (this
isn't quite true yet due to static parameters, but I'd like to
fix that in a separate commit). I think that's a desirable property
to simplify the life os pass authors.