-
-
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
elide code marked with @boundscheck(...)
.
#14474
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
220807b
Elide boundscheck blocks when inbounds.
blakejohnson c9587a7
Add tests for bounds check elimination.
blakejohnson c377624
Update inbounds context regardless of options.
blakejohnson cd7686b
Inject inbounds statements during inlining.
blakejohnson ef07a23
Fix inbounds blocks inside boundscheck blocks.
blakejohnson 7f330f0
Add inbounds meta elimination pass.
blakejohnson 4c93e67
Update AST docs for :inbounds and :boundscheck.
blakejohnson 0f6ec72
Minor boundscheck test refactoring.
blakejohnson 1c29b3c
Add deprecation for 2-arg `@boundscheck`.
blakejohnson 09fb69b
Create a mechanism to propagate an inbounds context.
blakejohnson bf5d6ca
Add a user-facing version of `@propagate_inbounds`.
blakejohnson 5ea20fc
Patch up dangling BasicBlocks from skipped labels.
blakejohnson 96e8230
Throw error in emit_gcpops on a malformed BasicBlock.
blakejohnson d50f28f
Minor formatting change in codegen.
blakejohnson 43357df
Enable boundscheck tests.
blakejohnson ab57cac
Mark `checkbounds(...)` callsites with `@boundscheck`.
blakejohnson 03a4e51
Document boundscheck elimination mechanism.
blakejohnson b74533a
`boundscheck` to `inbounds` in comprehension lowering.
blakejohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,12 +139,17 @@ These symbols appear in the ``head`` field of ``Expr``\s in lowered form. | |
``leave`` | ||
pop exception handlers. ``args[1]`` is the number of handlers to pop. | ||
|
||
``boundscheck`` | ||
``inbounds`` | ||
controls turning bounds checks on or off. A stack is maintained; if the | ||
first argument of this expression is true or false (``true`` means bounds | ||
checks are enabled), it is pushed onto the stack. If the first argument is | ||
``:pop``, the stack is popped. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this correct or should it be "bounds checks are disabled"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, |
||
``boundscheck`` | ||
indicates the beginning or end of a section of code that performs a bounds | ||
check. Like ``inbounds``, a stack is maintained, and the second argument | ||
can be one of: ``true``, ``false``, or ``:pop``. | ||
|
||
``copyast`` | ||
part of the implementation of quasi-quote. The argument is a surface syntax | ||
AST that is simply copied recursively and returned at run time. | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeffBezanson For some reason, unpacking returned Tuples like this doesn't seem to exist elsewhere in
inference.jl
. Is there a reason it is avoided?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, but I would guess that most of
inference.jl
was written at a time when that wasn't available at this point in the bootstrap. If it's working for you, maybe now that functionality is available (perhaps due to @vtjnash's reorganization in #11274)?This is pure speculation on my part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is any reason to avoid it.