-
Notifications
You must be signed in to change notification settings - Fork 35
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
llvmcall errors for some Vec sizes #61
Comments
Right I think it turns out that LLVM creates invalid code for vector lengths that are not multiplies of 2 and Julia chooses a different representation for them. Couldn't quickly find where that happens, but I remember investigating this years ago. |
See discussion in #1. |
So this is Julia applying a work-around for a long-standing bug in LLVM? Which vector lengths are working in Julia? SIMD should emit an error message for these. |
From: https://docs.julialang.org/en/v1/base/simd-types/ Although the vector length 12 also seems to work, even though it's not in the above-mentioned set. |
Rather than an error message, how about letting |
I investigated that some time ago: https://github.com/KristofferC/Tensors.jl/blob/218188cbfb3d755d5fbdd5c33efc115942b9781a/src/simd.jl#L33-L34. I don't remember which Juila/LLVM version that was for though. |
It seems the respective bug in LLVM was corrected in 2017 (see https://bugs.llvm.org/show_bug.cgi?id=27708). We might just be able to remove that special rule again (see |
Yes, removing the special case that only allows certain vector sizes seems to work fine now when this special casing is removed. (It was necessary for LLVM 3.8 and earlier.) |
Wow! After merging JuliaLang/julia#34490 and JuliaLang/julia#34473 SIMD.jl works beautifully! (I had almost given up on using this package due to segfaults and other problems.) Maybe mention these PRs in the readme until they are in a Julia release? |
This is now fixed upstream. Will be in Julia 1.4. |
Example:
(For other lengths, such as 6 or 8, there's no error. )
I suspect this has to to with
NTuple{N, VecElement{T}}
not mapping to a LLVMvector
for all values ofN
.The text was updated successfully, but these errors were encountered: