ValueNumStore* vnStore = m_pCompiler->vnStore;
// Get the VN for the upper limit.
- ValueNum uLimitVN = vnStore->VNNormalValue(upper->gtVNPair, VNK_Conservative);
+ ValueNum uLimitVN = vnStore->VNConservativeNormalValue(upper->gtVNPair);
#ifdef DEBUG
JITDUMP(FMT_VN " upper bound is: ", uLimitVN);
GenTree* treeIndex = bndsChk->gtIndex;
// Take care of constant index first, like a[2], for example.
- ValueNum idxVn = m_pCompiler->vnStore->VNNormalValue(treeIndex->gtVNPair, VNK_Conservative);
- ValueNum arrLenVn = m_pCompiler->vnStore->VNNormalValue(bndsChk->gtArrLen->gtVNPair, VNK_Conservative);
+ ValueNum idxVn = m_pCompiler->vnStore->VNConservativeNormalValue(treeIndex->gtVNPair);
+ ValueNum arrLenVn = m_pCompiler->vnStore->VNConservativeNormalValue(bndsChk->gtArrLen->gtVNPair);
int arrSize = 0;
if (m_pCompiler->vnStore->IsVNConstant(arrLenVn))
genTreeOps cmpOper = GT_NONE;
LclSsaVarDsc* ssaData = m_pCompiler->lvaTable[lcl->gtLclNum].GetPerSsaData(lcl->gtSsaNum);
- ValueNum normalLclVN = m_pCompiler->vnStore->VNNormalValue(ssaData->m_vnPair, VNK_Conservative);
+ ValueNum normalLclVN = m_pCompiler->vnStore->VNConservativeNormalValue(ssaData->m_vnPair);
// Current assertion is of the form (i < len - cns) != 0
if (curAssertion->IsCheckedBoundArithBound())
}
#endif
- ValueNum arrLenVN = m_pCompiler->vnStore->VNNormalValue(m_pCurBndsChk->gtArrLen->gtVNPair, VNK_Conservative);
+ ValueNum arrLenVN = m_pCompiler->vnStore->VNConservativeNormalValue(m_pCurBndsChk->gtArrLen->gtVNPair);
if (m_pCompiler->vnStore->IsVNConstant(arrLenVN))
{
void RangeCheck::MergeAssertion(BasicBlock* block, GenTree* op, Range* pRange DEBUGARG(int indent))
{
JITDUMP("Merging assertions from pred edges of " FMT_BB " for op [%06d] " FMT_VN "\n", block->bbNum,
- Compiler::dspTreeID(op), m_pCompiler->vnStore->VNNormalValue(op->gtVNPair, VNK_Conservative));
+ Compiler::dspTreeID(op), m_pCompiler->vnStore->VNConservativeNormalValue(op->gtVNPair));
ASSERT_TP assertions = BitVecOps::UninitVal();
// If we have a phi arg, we can get to the block from it and use its assertion out.
bool newlyAdded = !m_pSearchPath->Set(expr, block);
Range range = Limit(Limit::keUndef);
- ValueNum vn = m_pCompiler->vnStore->VNNormalValue(expr->gtVNPair, VNK_Conservative);
+ ValueNum vn = m_pCompiler->vnStore->VNConservativeNormalValue(expr->gtVNPair);
// If newly added in the current search path, then reduce the budget.
if (newlyAdded)
{
#ifdef DEBUG
// For PtrToLoc, lib == cons.
VNFuncApp consFuncApp;
- assert(GetVNFunc(VNNormalValue(opA->gtVNPair, VNK_Conservative), &consFuncApp) && consFuncApp.Equals(funcApp));
+ assert(GetVNFunc(VNConservativeNormalValue(opA->gtVNPair), &consFuncApp) && consFuncApp.Equals(funcApp));
#endif
ValueNum fldSeqVN = VNForFieldSeq(fldSeq);
res = VNForFunc(TYP_BYREF, VNF_PtrToLoc, funcApp.m_args[0], FieldSeqVNAppend(funcApp.m_args[1], fldSeqVN));
rhsVNPair = vnStore->VNPairApplySelectors(rhsVNPair, rhsFldSeq, indType);
}
}
- else if (vnStore->GetVNFunc(vnStore->VNNormalValue(srcAddr->gtVNPair, VNK_Liberal),
- &srcAddrFuncApp))
+ else if (vnStore->GetVNFunc(vnStore->VNLiberalNormalValue(srcAddr->gtVNPair), &srcAddrFuncApp))
{
if (srcAddrFuncApp.m_func == VNF_PtrToStatic)
{
if (obj != nullptr)
{
// construct the ValueNumber for 'fldMap at obj'
- normVal = vnStore->VNNormalValue(obj->gtVNPair, VNK_Liberal);
+ normVal = vnStore->VNLiberalNormalValue(obj->gtVNPair);
valAtAddr =
vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, normVal);
}
else // (staticOffset != nullptr)
{
// construct the ValueNumber for 'fldMap at staticOffset'
- normVal = vnStore->VNNormalValue(staticOffset->gtVNPair, VNK_Liberal);
+ normVal = vnStore->VNLiberalNormalValue(staticOffset->gtVNPair);
valAtAddr =
vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, normVal);
}
// We take the "VNNormalValue"s here, because if either has exceptional outcomes, they will be captured
// as part of the value of the composite "addr" operation...
- ValueNum arrVN = vnStore->VNNormalValue(arr->gtVNPair, VNK_Liberal);
+ ValueNum arrVN = vnStore->VNLiberalNormalValue(arr->gtVNPair);
inxVN = vnStore->VNNormalValue(inxVN);
// Additionally, relabel the address with a PtrToArrElem value number.
if (obj != nullptr)
{
// construct the ValueNumber for 'fldMap at obj'
- ValueNum objNormVal = vnStore->VNNormalValue(obj->gtVNPair, VNK_Liberal);
+ ValueNum objNormVal = vnStore->VNLiberalNormalValue(obj->gtVNPair);
valAtAddr = vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, objNormVal);
}
else if (staticOffset != nullptr)
{
// construct the ValueNumber for 'fldMap at staticOffset'
- ValueNum offsetNormVal = vnStore->VNNormalValue(staticOffset->gtVNPair, VNK_Liberal);
+ ValueNum offsetNormVal = vnStore->VNLiberalNormalValue(staticOffset->gtVNPair);
valAtAddr = vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, offsetNormVal);
}
// The Normal value is the value number of the expression when no exceptions occurred
ValueNum VNNormalValue(ValueNumPair vnp, ValueNumKind vnk);
+ // Given a "vnp", get the NormalValuew for the VNK_Liberal part of that ValueNum
+ // The Normal value is the value number of the expression when no exceptions occurred
+ inline ValueNum VNLiberalNormalValue(ValueNumPair vnp)
+ {
+ return VNNormalValue(vnp, VNK_Liberal);
+ }
+
+ // Given a "vnp", get the NormalValuew for the VNK_Conservative part of that ValueNum
+ // The Normal value is the value number of the expression when no exceptions occurred
+ inline ValueNum VNConservativeNormalValue(ValueNumPair vnp)
+ {
+ return VNNormalValue(vnp, VNK_Conservative);
+ }
+
// Given a "vnp", get the Normal values for both the liberal and conservative parts of "vnp"
// The Normal value is the value number of the expression when no exceptions occurred
ValueNumPair VNPNormalPair(ValueNumPair vnp);