}
// Returns the value number for zero of the given "typ".
-// It has an unreached() for a "typ" that has no zero value, such as TYP_BYREF.
+// It has an unreached() for a "typ" that has no zero value, such as TYP_VOID.
ValueNum ValueNumStore::VNZeroForType(var_types typ)
{
switch (typ)
case TYP_REF:
case TYP_ARRAY:
return VNForNull();
+ case TYP_BYREF:
+ return VNForByrefCon(0);
case TYP_STRUCT:
#ifdef FEATURE_SIMD
// TODO-CQ: Improve value numbering for SIMD types.
{
#ifndef _TARGET_64BIT_
case TYP_REF:
+ case TYP_BYREF:
#endif
case TYP_INT:
{
else
return VNForLongCon(INT64(arg0Val));
#endif
+ case TYP_BYREF:
+ assert(typ == TYP_BYREF);
+ return VNForByrefCon((INT64)arg0Val);
case TYP_FLOAT:
assert(typ == TYP_FLOAT);
if (srcIsUnsigned)
{
#ifdef _TARGET_64BIT_
case TYP_REF:
+ case TYP_BYREF:
#endif
case TYP_LONG:
INT64 arg0Val = GetConstantInt64(arg0VN);
case TYP_ULONG:
assert(typ == TYP_LONG);
return arg0VN;
+ case TYP_BYREF:
+ assert(typ == TYP_BYREF);
+ return VNForByrefCon((INT64)arg0Val);
case TYP_FLOAT:
assert(typ == TYP_FLOAT);
if (srcIsUnsigned)