It is impossible to implement a span-like container where JIT would elide a custom bounds check #109043
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
tenet-performance
Performance related issue
untriaged
New issue has not been triaged by the area owner
Description
Given a custom span-like container
Slice<T>
and a for loop that iterates over it:The
For
method compiles toAnalysis
It appears that no matter the implementation, it is impossible to write the code in a way where the bounds check is elided.
E.g. none of these changes work:
!(index >= slice.Length)
Length
a fieldConfiguration
Regression?
No
The text was updated successfully, but these errors were encountered: