summaryrefslogtreecommitdiff
path: root/src/jit/assertionprop.cpp
diff options
context:
space:
mode:
authorEugene Rozenfeld <erozen@microsoft.com>2019-01-10 14:53:24 -0800
committerEugene Rozenfeld <erozen@microsoft.com>2019-01-11 16:12:34 -0800
commit4bda36ad1da00ea80578b0de2b18e26a9f56a573 (patch)
tree0336af06c6de98293e1cbf2d4ebdd17affa5b5ce /src/jit/assertionprop.cpp
parent7a60e9e4a2987494fd6ea6d60644654713945a4f (diff)
downloadcoreclr-4bda36ad1da00ea80578b0de2b18e26a9f56a573.tar.gz
coreclr-4bda36ad1da00ea80578b0de2b18e26a9f56a573.tar.bz2
coreclr-4bda36ad1da00ea80578b0de2b18e26a9f56a573.zip
Generate non-null assertion for byrefs if we can't find corresponding refs.
When we have a non-null fact about a byref, we try to find the corresponding ref and generate an assertion about the ref. Then it can be used on byrefs if the offset is not too big. We use both trees and value numbers to find the ref. When the ref wasn't found we bailed on generating the assertion. I found that we get a number of good diffs if we generate assertions for byrefs when refs can't be found so this change enables that.
Diffstat (limited to 'src/jit/assertionprop.cpp')
-rw-r--r--src/jit/assertionprop.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp
index 2968820599..cb7454d29d 100644
--- a/src/jit/assertionprop.cpp
+++ b/src/jit/assertionprop.cpp
@@ -923,7 +923,8 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
//
// We only perform null-checks on GC refs
- // so only make non-null assertions about GC refs
+ // so only make non-null assertions about GC refs or byrefs if we can't determine
+ // the corresponding ref.
//
if (lclVar->TypeGet() != TYP_REF)
{
@@ -957,7 +958,7 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1,
}
}
- if (fgIsBigOffset(offset) || (vnStore->TypeOfVN(vn) != TYP_REF))
+ if (fgIsBigOffset(offset))
{
goto DONE_ASSERTION; // Don't make an assertion
}