-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
RyuJIT: Index Variable Widening optimization for array accesses #7312
Comments
Copying over @mikedn's comment from dup dotnet/coreclr#11608:
|
It is possible to have Unfortunately this fails to work in the common case - |
I wonder if it would be worth having an operator like |
We could probably have loop cloning preserve the range check and set GTF_ARR_BOUND_INBND so it is removed at a later time. But that may mean that assertion prop will do more work because it encounters more range checks. I'll have to check if there other assertion kinds that can be used for this, loop cloning conditions should generate some. There's also the question if loop cloning should be done so early, seems strange to me. |
I'm dumb, in the common case there will be no loop cloning conditions. There are probably only two ways to get this trick to work after loop cloning:
|
There's some related discussion also here: dotnet/coreclr#21553. In summary, instead of/in addition to simply widening:
|
The expected benefits are somewhat reduced since #57970 removed If we know that the index variable is 32-bit, could we just elide the zero-extension (cast) entirely because any time we load it to a register (or increment/modify it) it will be implicitly zero-extended anyway? Only situation that would need special handling then is if the index is from a narrowing cast - this should do an actual |
Fixed by #97865 |
There are many benchstone benchmarks that would benefit from IV widening, which currently Legacy Jit64 does.
From benchmarkgames Mandelbrot and Nbody are such examples.
category:cq
theme:loop-opt
skill-level:expert
cost:large
The text was updated successfully, but these errors were encountered: