-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fixes to bounds inference on shift_left #5477
Merged
Merged
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2c308ac
Add shift_left fix for signed integers by possibly negative values + …
rootjalex 54f5f74
add required condition on shift_left integer fix
rootjalex 04311b6
add type check to shift_left minimum condition
rootjalex a3f3323
fix constant folding of shifts with |b| >= type.bits() for types that…
rootjalex d9230a6
make regression tests use scoped bindings
rootjalex 084976e
change condition in case int24/int48 proposal happens soon
rootjalex a81a878
Merge branch 'master' of https://github.com/halide/Halide into ajr-sh…
rootjalex 1d14dc6
revert changes based on overflow expectations
rootjalex 9898a11
add more regression tests
rootjalex 9d5b35d
clarify comment
rootjalex 0594730
add shift_left min handler for b only UB
rootjalex 030d36d
fix clang-tidy complaint
rootjalex c4b7b8a
relax shift_left of non-negative value constraint
rootjalex e8bcdf2
pull case outside of unnecessary preconditions
rootjalex 343b5b0
fix clang-format complaint
rootjalex 86e362e
fix broken precondition
rootjalex b725708
add typecheck to possibly save a can_prove() call
rootjalex 3055665
add easy-out type check to precondition
rootjalex 1a8930e
Add descriptive comment to bug fix + add another early-exit precondition
rootjalex 89b0e19
Merge branch 'master' into rootjalex/shift_left_fix
steven-johnson 153871f
Merge branch 'master' into rootjalex/shift_left_fix
steven-johnson 983e492
Merge branch 'master' into rootjalex/shift_left_fix
steven-johnson File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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.
Is it the case that b_interval.min and b_interval.max are always the same type? (i.e., this implies that b_interval.max is also a non-uint?)
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 believe that this should be the case, but @abadams might contradict me. I have been operating under the assumption that that invariant is maintained.
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.
(Would be nice to have that documented somewhere, though that's orthogonal to this PR.)
I ask mainly because code lower down seemed to be optimized based on that assumption, but it wasn't clear to me whether deliberate or not.
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 agree, all of the changes I have made to bounds inference assumes that the type of the min, type of the max, and type of the operation are all equal.