Jit intrinsics for Span<T>.get_Item and ReadOnlySpan<T>.get_Item. (dotnet/coreclr...
authorAndy Ayers <andya@microsoft.com>
Mon, 17 Apr 2017 20:04:23 +0000 (13:04 -0700)
committerGitHub <noreply@github.com>
Mon, 17 Apr 2017 20:04:23 +0000 (13:04 -0700)
commit9259b4f2726a0db3e763c270930ec4e18633fc18
treee5a74b1815724e83efcbb19c3a44dab488bfff37
parente47217834f274847dcb329ff63acc609b89e6f67
Jit intrinsics for Span<T>.get_Item and ReadOnlySpan<T>.get_Item. (dotnet/coreclr#10910)

Implement these two methods as optional-expand jit intrinsics.
Uses `GT_ARR_BOUNDS_CHECK` for the bounds check so in some cases
downstream code is able to eliminate redundant checks. Fully general
support (on par with arrays in most cases) is still work in progress.

Update one bit of code in the optimizer that assumed it knew the
tree types that appeared in a `GT_ARR_BOUNDS_CHECK`.

Add benchmark tests for Span and ReadOnlySpan indexers.

Tests ability of jit to reason about indexer properties with respect
to loop bounds and related indexer uses. Some cases inspired by span
indexer usage in Kestrel.

Closes dotnet/coreclr#10785.

Also addresses lack of indexer inlining noted in dotnet/coreclr#10031. Span indexers
should now always be inlined, even when invoked from shared methods.

Commit migrated from https://github.com/dotnet/coreclr/commit/c06fb332e7bb77a55bda724a56b33d6094a0a042
src/coreclr/src/inc/corinfo.h
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/optimizer.cpp
src/coreclr/src/vm/jitinterface.cpp
src/coreclr/src/vm/method.cpp
src/coreclr/src/vm/mscorlib.h
src/coreclr/tests/src/JIT/Performance/CodeQuality/Span/Indexer.cs [new file with mode: 0644]
src/coreclr/tests/src/JIT/Performance/CodeQuality/Span/Indexer.csproj [new file with mode: 0644]
src/coreclr/tests/src/JIT/config/benchmark/project.json