-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Cast pointer instead of value when loading array/tuple lengths? #8042
Comments
I think this change would be good. Casting the pointer type first makes more sense to me. If somebody gets to it before I do, I'll merge it :) |
I'll take a stab at it since I need to do it anyway to play with the range metadata. |
ArchRobison
pushed a commit
to ArchRobison/julia
that referenced
this issue
Aug 18, 2014
…inter and load.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Julia currently loads array lengths by loading a pointer and casting the loaded value to an int. E.g.:
In somewhat similar situations, Clang casts the pointer and then does the load. There's probably no net difference for now, but I see that LLVM trunk has range metadata that can be used to indicate the ranges of integers, such as an array length, which can enable it to eliminate unnecessary checks in some cases. (I'm investigating one for a common
@simd
use case.) Is there any reason for the Julia instruction sequence other than it was slightly simpler to implement?The text was updated successfully, but these errors were encountered: