diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2016-09-20 16:09:32 -0400 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2016-09-20 17:28:39 -0400 |
commit | 0aebfbef08a28b28dbf687d7f49cbc8369ea441a (patch) | |
tree | e849944750d11d2824f277817224757cfaec2c48 /src/jit/assertionprop.cpp | |
parent | a4bdd3b33762d07be30f207eb66be934ccd2ffb4 (diff) | |
download | coreclr-0aebfbef08a28b28dbf687d7f49cbc8369ea441a.tar.gz coreclr-0aebfbef08a28b28dbf687d7f49cbc8369ea441a.tar.bz2 coreclr-0aebfbef08a28b28dbf687d7f49cbc8369ea441a.zip |
Respect JitNoRangeChks flag in RyuJit
Honor this config flag by having assertion prop treat all bounds check
nodes as redundant when it is set.
Also change the flag's lookup options to `REGUTIL_default` to match the
rest of the jit-focused flags.
Note that support for this flag is conditional on having the preprocessor
flag `FEATURE_ENABLE_NO_RANGE_CHECKS` defined, which requires a custom
build with line 199 of inc/switches.h un-commented (or with compile flags
altered to include `-DFEATURE_ENABLE_NO_RANGE_CHECKS`) -- the purpose of
the flag is to facilitate experiments to estimate the cumulative cost of
bounds checking in various workloads.
Diffstat (limited to 'src/jit/assertionprop.cpp')
-rw-r--r-- | src/jit/assertionprop.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp index fe35c3b780..8a53278daf 100644 --- a/src/jit/assertionprop.cpp +++ b/src/jit/assertionprop.cpp @@ -3700,6 +3700,21 @@ GenTreePtr Compiler::optAssertionProp_BndsChk(ASSERT_VALARG_TP assertions, const assert(tree->gtOper == GT_ARR_BOUNDS_CHECK); +#ifdef FEATURE_ENABLE_NO_RANGE_CHECKS + if (JitConfig.JitNoRangeChks()) + { +#ifdef DEBUG + if (verbose) + { + printf("\nFlagging check redundant due to JitNoRangeChks in BB%02u:\n", compCurBB->bbNum); + gtDispTree(tree, nullptr, nullptr, true); + } +#endif // DEBUG + tree->gtFlags |= GTF_ARR_BOUND_INBND; + return nullptr; + } +#endif // FEATURE_ENABLE_NO_RANGE_CHECKS + BitVecOps::Iter iter(apTraits, assertions); unsigned index = 0; while (iter.NextElem(apTraits, &index)) |