-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Description
For code like:
void Foo(int[,] foo)
{
for (int i = foo.GetLowerBound(0); i < foo.GetUpperBound(0); i++)
{
int count = i * 100;
for (int j = foo.GetLowerBound(1); j < foo.GetUpperBound(1); j++)
{
foo[i, j] = count++;
}
}
}
we generate unnecessary bounds checks on the accesses within the loop. This pattern is also what Roslyn produces for foreach
over MD arrays, so we should be able to optimize it better.
Reported by @richlander
category:cq
theme:md-arrays
skill-level:expert
cost:large
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI