Skip to content

Commit 3347a45

Browse files
committed
Remove VNForCast fix
1 parent 0dfe56a commit 3347a45

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/coreclr/jit/valuenum.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12192,11 +12192,9 @@ ValueNum ValueNumStore::VNForCast(ValueNum srcVN,
1219212192
bool srcIsUnsigned, /* = false */
1219312193
bool hasOverflowCheck) /* = false */
1219412194
{
12195-
12196-
if ((castFromType == TYP_I_IMPL) && varTypeIsGC(castToType) && IsVNConstant(srcVN))
12195+
if ((castFromType == TYP_I_IMPL) && (castToType == TYP_BYREF) && IsVNHandle(srcVN))
1219712196
{
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.
12197+
// Omit cast for (h)CNS_INT [TYP_I_IMPL -> TYP_BYREF]
1220012198
return srcVN;
1220112199
}
1220212200

0 commit comments

Comments
 (0)