Skip to content

Commit

Permalink
Fix the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion committed Jun 9, 2022
1 parent 10166f5 commit f991889
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/coreclr/jit/rationalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,13 +556,6 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge
RewriteAssignment(use);
break;

case GT_BOX:
case GT_ARR_ADDR:
// BOX/ARR_ADDR at this level are just NOPs.
use.ReplaceWith(node->gtGetOp1());
BlockRange().Remove(node);
break;

case GT_ADDR:
RewriteAddress(use);
break;
Expand Down Expand Up @@ -594,9 +587,11 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge
break;

case GT_NOP:
// fgMorph sometimes inserts NOP nodes between defs and uses
// supposedly 'to prevent constant folding'. In this case, remove the
// NOP.
case GT_BOX:
case GT_ARR_ADDR:
// "optNarrowTree" sometimes inserts NOP nodes between defs and uses.
// In this case, remove the NOP. BOX/ARR_ADDR are such "passthrough"
// nodes by design, and at this point we no longer need them.
if (node->gtGetOp1() != nullptr)
{
use.ReplaceWith(node->gtGetOp1());
Expand Down

0 comments on commit f991889

Please sign in to comment.