Skip to content

[CIR] Always zero-extend shift amounts #1568

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

mmha
Copy link
Collaborator

@mmha mmha commented Apr 17, 2025

Negative shift amounts are undefined behavior in C and C++. Because of that we can always zero-extend the shift amount which is slightly faster on certain architectures (e. g. x86). This also matches the behavior of the original clang Codegen.

Backported from llvm/llvm-project#133405

Negative shift amounts are undefined behavior in C and C++. Because of
that we can always zero-extend the shift amount which is slightly faster
on certain architectures (e. g. x86). This also matches the behavior of
the original clang Codegen.
@bcardosolopes bcardosolopes changed the title Always zero-extend shift amounts [CIR] Always zero-extend shift amounts Apr 17, 2025
@bcardosolopes
Copy link
Member

Thanks!!

@bcardosolopes bcardosolopes merged commit 90833a4 into llvm:main Apr 17, 2025
10 checks passed
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