Skip to content

Eliminate bound checks for "% arr.Length" when possible #130155

Open

Description

@henriquewr

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

Activity

  1. added
    tenet-performance
    on Jul 3, 2026
  2. added
    untriaged
    on Jul 3, 2026
  3. added
    area-CodeGen-coreclr
    on Jul 3, 2026
  4. dotnet-policy-service commented on Jul 3, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
    See info in area-owners.md if you want to be subscribed.

  5. MihuBot commented on Jul 3, 2026

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  6. removed
    untriaged
    on Jul 17, 2026
  7. added this to the 11.0.0 milestone on Jul 17, 2026
  8. modified the milestones: 11.0.0, 12.0.0 on Aug 13, 2026
  9. dhartglassMSFT commented on Aug 13, 2026

    @dhartglassMSFT
    Contributor

    Changing milestone to 12 as we're at the deadline.

    @henriquewr thanks for opening this issue. Did you still plan to address this item?

  10. henriquewr commented on Aug 13, 2026

    @henriquewr
    Author

    @dhartglassMSFT
    I believe it's already adressed in the PR
    The CI errors don't appear to be related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrtenet-performance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions