Skip to content

Commit 2a77961

Browse files
authored
JIT: call IsVNNeverNegative in IsNeverNegative (dotnet#110118)
1 parent 9ec573e commit 2a77961

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/coreclr/jit/gentree.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30570,8 +30570,17 @@ bool GenTree::IsNeverNegative(Compiler* comp) const
3057030570
}
3057130571
}
3057230572

30573-
// TODO-Casts: extend IntegralRange to handle constants
30574-
return IntegralRange::ForNode(const_cast<GenTree*>(this), comp).IsNonNegative();
30573+
if (IntegralRange::ForNode(const_cast<GenTree*>(this), comp).IsNonNegative())
30574+
{
30575+
return true;
30576+
}
30577+
30578+
if ((comp->vnStore != nullptr) && comp->vnStore->IsVNNeverNegative(gtVNPair.GetConservative()))
30579+
{
30580+
return true;
30581+
}
30582+
30583+
return false;
3057530584
}
3057630585

3057730586
//------------------------------------------------------------------------

0 commit comments

Comments
 (0)