Improve perf for Index based span indexers (#21196)
authorAndy Ayers <andya@microsoft.com>
Tue, 27 Nov 2018 08:36:35 +0000 (00:36 -0800)
committerGitHub <noreply@github.com>
Tue, 27 Nov 2018 08:36:35 +0000 (00:36 -0800)
commitb01b2b8030f363368530b8a1395d604179e8d0e4
tree1d13be81d073edb4cd2d0f2ec589b04326f04fc0
parent870267fac0b16ac246d6ba01f49ba4c6acd2319c
Improve perf for Index based span indexers (#21196)

First, evaluate the actual index before invoking the underlying int indexer,
so that the jit doesn't think the span is address taken.

Second, improve the jit's ability to remove some redundant comparisons like
those that arise in computing the actual index.
src/System.Private.CoreLib/shared/System/ReadOnlySpan.Fast.cs
src/System.Private.CoreLib/shared/System/Span.Fast.cs
src/jit/assertionprop.cpp
src/jit/compiler.h