Eliminate bound checks for "% arr.Length" when possible
Open
area-CodeGen-coreclr
tenet-performance
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
The idea is to eliminate bound checks for:
`arr[(int)index % arr.Length]` when `index >= 0`
As discussed in the pr, the support of these will not be added:
`arr[arr.Length % (int)index]` when `arr.Length > 0 and index <= arr.Length`
`arr[(uint)arr.Length % (uint)index]` when `arr.Length > 0 and index <= arr.Length`
Contributor guide
Assessment
This issue has not been assessed yet.