-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Vectorized code computes a different result from the unvectorized code (see later comments) #63185
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
Comments
@llvm/issue-subscribers-julialang |
The good version is not vectorized because:
|
Yeah I minimized this one slightly too far, a moment. |
In essence this code (https://godbolt.org/z/11drEMfjx) when run through Julia's LLVM pass pipeline creates a bug. It should print 1.0, but optimizes to 2.0 |
Here is it post vectorization (see it prints 2): https://godbolt.org/z/4vqzxMbd8 Here is the vectorization itself as an llvm pass on trunc: https://godbolt.org/z/431xo6Tfc |
@fhahn if you might have any insights here. |
Hmm interesting, let me take a look in a bit |
The issue seems to be fixed now. I ran the optimization pipeline you showed minus the |
Edit: the bug is not related to address spaces, see later comments:
The following code examples are equivalent except for one having a non-zero address space for the first arg or not. The non-zero address space version is incorrectly marked as vectorizable whereas the second one is not.
Illegal case: https://godbolt.org/z/Wjodd6n5x
Correct case: https://godbolt.org/z/svPhcT84x
cc @vchuravy @jdoerfert
The text was updated successfully, but these errors were encountered: