-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Undesirable auto-vectorization on a simple for-loop #102709
Comments
@rustbot label +T-compiler +A-codegen +I-heavy +I-slow |
What exactly is the asm should rustc produce here? |
|
The unrolled one is ok. But the auto-vectorization looks terrible since there are so many |
It's small with opt-level
Note that rustc itself never does any auto-vectorization. So I would encourage you to file this as an |
I tried this code:
https://rust.godbolt.org/z/5dE9h9G3T
Compiler flags:
-C opt-level=3 -C target-feature=+avx2
I expected to see this happen: The function should be compiled to a small scalar loop.
Instead, this happened:
Huge ASM
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: