Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't propagate const TYP_REF as TYP_I_IMPL #75661

Merged
merged 15 commits into from
Sep 17, 2022
Merged
3 changes: 3 additions & 0 deletions src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3420,6 +3420,9 @@ GenTree* Compiler::optConstantAssertionProp(AssertionDsc* curAssertion,
// Here we have to allocate a new 'large' node to replace the old one
newTree = gtNewIconHandleNode(curAssertion->op2.u1.iconVal,
curAssertion->op2.u1.iconFlags & GTF_ICON_HDL_MASK);

// Make sure we don't change TYP_REF to an integer
newTree->ChangeType(tree->TypeGet());
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13080,7 +13080,7 @@ BYTE* emitter::emitOutputRI(BYTE* dst, instrDesc* id)
break;

case IF_RRW_CNS:
assert(id->idGCref() == GCT_BYREF);
assert((id->idGCref() == GCT_BYREF) || (id->idGCref() == GCT_GCREF));
EgorBo marked this conversation as resolved.
Show resolved Hide resolved

#ifdef DEBUG
regMaskTP regMask;
Expand Down
11 changes: 9 additions & 2 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11121,8 +11121,15 @@ void Compiler::gtDispConst(GenTree* tree)

if (tree->TypeGet() == TYP_REF)
{
assert(tree->AsIntCon()->gtIconVal == 0);
printf(" null");
if (tree->AsIntCon()->gtIconVal == 0)
{
printf(" null");
}
else
{
assert(doesMethodHaveFrozenString());
printf(" 0x%llx", dspIconVal);
}
}
else if ((tree->AsIntCon()->gtIconVal > -1000) && (tree->AsIntCon()->gtIconVal < 1000))
{
Expand Down