We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0dfe56a commit 3347a45Copy full SHA for 3347a45
src/coreclr/jit/valuenum.cpp
@@ -12192,11 +12192,9 @@ ValueNum ValueNumStore::VNForCast(ValueNum srcVN,
12192
bool srcIsUnsigned, /* = false */
12193
bool hasOverflowCheck) /* = false */
12194
{
12195
-
12196
- if ((castFromType == TYP_I_IMPL) && varTypeIsGC(castToType) && IsVNConstant(srcVN))
+ if ((castFromType == TYP_I_IMPL) && (castToType == TYP_BYREF) && IsVNHandle(srcVN))
12197
12198
- // Omit cast for CNS_INT [TYP_I_IMPL -> TYP_BYREF/TYP_REF]
12199
- // We can't check `IsVNHandle(srcVN)` because we may have lost handle information with shared const CSEs.
+ // Omit cast for (h)CNS_INT [TYP_I_IMPL -> TYP_BYREF]
12200
return srcVN;
12201
}
12202
0 commit comments