}
break;
+ case GT_CNS_INT:
+ if (node->IsIntegralConst(0) || node->IsIntegralConst(1))
+ {
+ return {SymbolicIntegerValue::Zero, SymbolicIntegerValue::One};
+ }
+ break;
+
+ case GT_QMARK:
+ return Union(ForNode(node->AsQmark()->ThenNode(), compiler),
+ ForNode(node->AsQmark()->ElseNode(), compiler));
+
case GT_CAST:
return ForCastOutput(node->AsCast());
return {lowerBound, upperBound};
}
+/* static */ IntegralRange IntegralRange::Union(IntegralRange range1, IntegralRange range2)
+{
+ return IntegralRange(min(range1.GetLowerBound(), range2.GetLowerBound()),
+ max(range1.GetUpperBound(), range2.GetUpperBound()));
+}
+
#ifdef DEBUG
/* static */ void IntegralRange::Print(IntegralRange range)
{
static IntegralRange ForNode(GenTree* node, Compiler* compiler);
static IntegralRange ForCastInput(GenTreeCast* cast);
static IntegralRange ForCastOutput(GenTreeCast* cast);
+ static IntegralRange Union(IntegralRange range1, IntegralRange range2);
#ifdef DEBUG
static void Print(IntegralRange range);
assert((colon != nullptr) && colon->OperIs(GT_COLON));
}
+ GenTree* ThenNode()
+ {
+ return gtOp2->AsColon()->ThenNode();
+ }
+
+ GenTree* ElseNode()
+ {
+ return gtOp2->AsColon()->ElseNode();
+ }
+
#if DEBUGGABLE_GENTREE
GenTreeQmark() : GenTreeOp()
{