Skip to content

Commit

Permalink
Add a more detailed dump output
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion committed Jun 2, 2021
1 parent 050041c commit bb0b7d5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/coreclr/jit/decomposelongs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1829,25 +1829,30 @@ GenTree* DecomposeLongs::OptimizeCastFromDecomposedLong(GenTreeCast* cast)
return nextNode;
}

JITDUMP("Optimized a truncating cast [%06u] from decomposed LONG [%06u] to %s:\n", cast->gtTreeID, src->gtTreeID,
varTypeName(dstType));
JITDUMP("Optimizing a truncating cast [%06u] from decomposed LONG [%06u]\n", cast->gtTreeID, src->gtTreeID);
INDEBUG(GenTree* treeToDisplay = cast);

// TODO-CQ: we could go perform this removal transitively.
// See also identical code in shift decomposition.
if ((hiSrc->gtFlags & (GTF_ALL_EFFECT | GTF_SET_FLAGS)) == 0)
{
JITDUMP("Removing the HI part of [%06u] and marking its operands unused:\n", src->gtTreeID);
DISPNODE(hiSrc);
Range().Remove(hiSrc, /* markOperandsUnused */ true);
}
else
{
JITDUMP("The HI part of [%06u] has side effects, marking it unused\n", src->gtTreeID);
hiSrc->SetUnusedValue();
}

JITDUMP("Removing the LONG source:\n");
DISPNODE(src);
Range().Remove(src);

if (varTypeIsSmall(dstType))
{
JITDUMP("Cast is to a small type, keeping it, the new source is [%06u]\n", loSrc->gtTreeID);
cast->CastOp() = loSrc;
}
else
Expand All @@ -1862,11 +1867,16 @@ GenTree* DecomposeLongs::OptimizeCastFromDecomposedLong(GenTreeCast* cast)
loSrc->SetUnusedValue();
}

INDEBUG(treeToDisplay = loSrc);
nextNode = cast->gtNext;

INDEBUG(treeToDisplay = loSrc);
JITDUMP("Removing the cast:\n");
DISPNODE(cast);

Range().Remove(cast);
}

JITDUMP("Final result:\n")
DISPTREERANGE(Range(), treeToDisplay);

return nextNode;
Expand Down

0 comments on commit bb0b7d5

Please sign in to comment.