summaryrefslogtreecommitdiff
path: root/src/jit/rangecheck.h
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2018-02-27 16:11:23 -0800
committerBrian Sullivan <briansul@microsoft.com>2018-02-27 16:11:23 -0800
commita44e805d0dea89ec370fc146210d718fc17e7d03 (patch)
tree0a7c391beb638ba236170ad2b434cf4a651f44db /src/jit/rangecheck.h
parentdbd533372e41b029398839056450c0fcac2b91f0 (diff)
downloadcoreclr-a44e805d0dea89ec370fc146210d718fc17e7d03.tar.gz
coreclr-a44e805d0dea89ec370fc146210d718fc17e7d03.tar.bz2
coreclr-a44e805d0dea89ec370fc146210d718fc17e7d03.zip
Minimal Fix for the incorrect rangecheck elimination issue reported by Mike Danes
RangeCheck::IsBinOpMonotonicallyIncreasing has a bug that results in incorrect range check elimination – when the second operand is a lclvar it does not check if it’s a positive value, it only checks if it’s monotonically increasing and any constant is treated as such. [tfs-changeset: 1689890]
Diffstat (limited to 'src/jit/rangecheck.h')
-rw-r--r--src/jit/rangecheck.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jit/rangecheck.h b/src/jit/rangecheck.h
index 9c0f567dc7..8b97308502 100644
--- a/src/jit/rangecheck.h
+++ b/src/jit/rangecheck.h
@@ -521,7 +521,8 @@ public:
// Given an "expr" trace its rhs and their definitions to check if all the assignments
// are monotonically increasing.
- bool IsMonotonicallyIncreasing(GenTree* tree);
+ //
+ bool IsMonotonicallyIncreasing(GenTree* tree, bool rejectNegativeConst);
// We allocate a budget to avoid walking long UD chains. When traversing each link in the UD
// chain, we decrement the budget. When the budget hits 0, then no more range check optimization