Skip to content
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

[Backport llvm-project#97148][AArch64] Avoid overflow when using shl lower mul #174

Merged
merged 1 commit into from
Jun 30, 2024

Conversation

DianQK
Copy link
Member

@DianQK DianQK commented Jun 30, 2024

Fixes llvm#97147.

Transforming `(mul x, -(2^(N-M) - 1) * 2^M)` to `(sub (shl x, M), (shl
x, N))` will cause overflow when N is 32 and M is 31. I still added
checks for all scenarios, even other scenarios, don't seem to cause overflow.

(cherry picked from commit 4a96803)
@DianQK DianQK requested a review from a team June 30, 2024 14:16
@nikic nikic merged commit 934954a into rust-lang:rustc/18.1-2024-05-19 Jun 30, 2024
@DianQK DianQK deleted the backport-97148 branch June 30, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants