diff options
author | Bruce Forstall <brucefo@microsoft.com> | 2017-05-19 13:58:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-19 13:58:35 -0700 |
commit | 698a89e6e2d6866666dd942bdf7506f96fb8310e (patch) | |
tree | 60e7a4d7b8942793d7772281a6dfbf891a49be42 /src/jit/rangecheck.cpp | |
parent | 6ce65bd1bc1570e4e37b6f6c7c5acb640e6dcac5 (diff) | |
download | coreclr-698a89e6e2d6866666dd942bdf7506f96fb8310e.tar.gz coreclr-698a89e6e2d6866666dd942bdf7506f96fb8310e.tar.bz2 coreclr-698a89e6e2d6866666dd942bdf7506f96fb8310e.zip |
Improve BitVecOps<>::Iter::NextElem (#11696)
* Improve BitVecOps<>::Iter::NextElem
Tweak the implementation, to reduce the number of instructions
executed in the hot path.
Also, don't pass "env" to NextElem; it can be stored by Init()
if required. For non-inlined calls, this saves setting up one
argument.
Use a `m_bsEnd` end condition. This eliminates the need to handle
short/long differently, and reduces conditions when updating
the current bits to iterate over in the long case.
Overall, pin shows this reduces instruction count of superpmi over
a minopts test run by 2.6% (NextElem is very hot).
Also, fix BitSetAsUInt64 NextElem() iterator: It should store and updated
its own bit count, and not depend on the value passed in to be the
correct latest bit count.
Diffstat (limited to 'src/jit/rangecheck.cpp')
-rw-r--r-- | src/jit/rangecheck.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jit/rangecheck.cpp b/src/jit/rangecheck.cpp index 91ae81e322..403113255b 100644 --- a/src/jit/rangecheck.cpp +++ b/src/jit/rangecheck.cpp @@ -502,7 +502,7 @@ void RangeCheck::MergeEdgeAssertions(GenTreePtr tree, const ASSERT_VALARG_TP ass // Walk through the "assertions" to check if the apply. BitVecOps::Iter iter(m_pCompiler->apTraits, assertions); unsigned index = 0; - while (iter.NextElem(m_pCompiler->apTraits, &index)) + while (iter.NextElem(&index)) { index++; |