@@ -68,6 +68,50 @@ bool IntegralRange::Contains(int64_t value) const
6868 return SymbolicToRealMap[static_cast <int32_t >(value)];
6969}
7070
71+ // ------------------------------------------------------------------------
72+ // GetUpperBound: Get the largest possible value "type" can represent
73+ //
74+ // Arguments:
75+ // node - the node, of an integral type, in question
76+ // type - the integral type in question
77+ // compiler - the Compiler, used to retrieve additional info
78+ //
79+ // Return Value:
80+ // the largest possible value "type" can represent.
81+ //
82+ /* static */ size_t IntegralRange::GetUpperBound (GenTree* node, var_types type, Compiler* compiler)
83+ {
84+ IntegralRange valRange = IntegralRange::ForNode (node, compiler);
85+ #if defined(HOST_X86) || defined(HOST_ARM)
86+ return (int32_t )IntegralRange::SymbolicToRealValue (valRange.UpperBoundForType (type));
87+ #else
88+ return IntegralRange::SymbolicToRealValue (valRange.UpperBoundForType (type));
89+ #endif
90+
91+ }
92+
93+ // ------------------------------------------------------------------------
94+ // GetUpperBound: Get the smallest possible value "type" can represent
95+ //
96+ // Arguments:
97+ // node - the node, of an integral type, in question
98+ // type - the integral type in question
99+ // compiler - the Compiler, used to retrieve additional info
100+ //
101+ // Return Value:
102+ // the smallest possible value "type" can represent.
103+ //
104+ /* static */ size_t IntegralRange::GetLowerBound (GenTree* node, var_types type, Compiler* compiler)
105+ {
106+ IntegralRange valRange = IntegralRange::ForNode (node, compiler);
107+ #if defined(HOST_X86) || defined(HOST_ARM)
108+ return (int32_t )IntegralRange::SymbolicToRealValue (valRange.LowerBoundForType (type));
109+ #else
110+ return IntegralRange::SymbolicToRealValue (valRange.LowerBoundForType (type));
111+
112+ #endif
113+ }
114+
71115// ------------------------------------------------------------------------
72116// LowerBoundForType: Get the symbolic lower bound for a type.
73117//
0 commit comments