-
Notifications
You must be signed in to change notification settings - Fork 16
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
Cherry pick fixes for large signed constant truncation #630
Cherry pick fixes for large signed constant truncation #630
Conversation
For integers larger than 64-bit, this would zero-extend a -1 value, instead of sign-extending it. Fixes llvm/llvm-project#80289.
If the uint64_t constructor is used, assert that the value is actuall a signed or unsigned N-bit integer depending on whether the isSigned flag is set. Currently, we allow values to be silently truncated, which is a constant source of subtle bugs -- a particularly common mistake is to create -1 values without setting the isSigned flag, which will work fine for all common bit widths (<= 64-bit) and miscompile for larger integers.
Please note that in the last commit, just parts that fix large signed constant truncation of the upstream PR are taken. |
Benchmark results:
|
Regressions tests are failing, because clang-tidy is complaining about the following:
This is a common code, so I don't think we should address it, since rebase will be harder. |
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.
Thank you for cherry-picking.
No description provided.