Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #10248 from mikedn/fix-vnarrbound
Browse files Browse the repository at this point in the history
Fix ValueNumStore::IsVNArrLenUnsignedBound checks
  • Loading branch information
JosephTremoulet committed Mar 17, 2017
2 parents ce118e5 + 54b1709 commit e93885e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3182,21 +3182,21 @@ bool ValueNumStore::IsVNArrLenUnsignedBound(ValueNum vn, ArrLenUnsignedBoundInfo

if (GetVNFunc(vn, &funcApp))
{
if (IsVNArrLen(funcApp.m_args[1]))
if ((funcApp.m_func == VNF_LT_UN) || (funcApp.m_func == VNF_GE_UN))
{
// We only care about "(uint)i < (uint)a.len" and its negation "(uint)i >= (uint)a.len"
if ((funcApp.m_func == VNF_LT_UN) || (funcApp.m_func == VNF_GE_UN))
if (IsVNArrLen(funcApp.m_args[1]))
{
info->vnIdx = funcApp.m_args[0];
info->cmpOper = funcApp.m_func;
info->vnLen = funcApp.m_args[1];
return true;
}
}
else if (IsVNArrLen(funcApp.m_args[0]))
else if ((funcApp.m_func == VNF_GT_UN) || (funcApp.m_func == VNF_LE_UN))
{
// We only care about "(uint)a.len > (uint)i" and its negation "(uint)a.len <= (uint)i"
if ((funcApp.m_func == VNF_GT_UN) || (funcApp.m_func == VNF_LE_UN))
if (IsVNArrLen(funcApp.m_args[0]))
{
info->vnIdx = funcApp.m_args[1];
// Let's keep a consistent operand order - it's always i < a.len, never a.len > i
Expand Down

0 comments on commit e93885e

Please sign in to comment.