dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

JIT: (x u>> cns) -> [0..(x's max value >> cns)] #109900

Closed EgorBo closed 2 days ago

EgorBo commented 5 days ago

Optimizes bounds check for https://github.com/dotnet/runtime/issues/109899

EgorBo commented 4 days ago

PTAL @AndyAyersMS @dotnet/jit-contrib a change to optimize bounds check for "arr[X >> CNS]" pattern in order to remove unsafe code from the repo