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
Weird allocation that depends on array contents #36751
Comments
Don't use |
The same behaviour can be observed with |
Please ask further questions on discourse.julialang.org. This is not a bug.
Most likely because you aren't using
No. |
A few of things to keep in mind:
|
@yuyichao, please be kinder to people posting issues. Yes, Discourse is where questions should be asked, but it's not always clear whether something is a real issue or not. The intention here is clearly to raise a possible problem which is greatly appreciated. We can and should explain that this is not a problem politely and gracefully. |
@StefanKarpinski thanks for the patient explanation! I'll know what to look for next time. |
I came across this odd behaviour today when trying to work out where this 16 byte allocation was coming from. Whether or not the function allocates seems to be something to do with the length, which is perhaps reasonable (in the generated LLVM there is a scalar/vector switch based on the length of the vector). It also seems to be affected by the contents of the vector - the latter is more surprising to me.
The behaviour doesn't change when the
@inbounds
is removed, despite that preventing vector instruction generation.I also see this behaviour on
Julia Version 1.5.0-rc1.0
.It would be great to hear a sensible explanation!
The text was updated successfully, but these errors were encountered: