Skip to content

Commit

Permalink
Enable global constant propagation for GT_LCL_FLD (#61209)
Browse files Browse the repository at this point in the history
These are leaf nodes without side effects, and we can
sometimes evaluate them in VN, so it does not seem like
there is any reason not to enable propagation for them.
  • Loading branch information
SingleAccretion committed Nov 8, 2021
1 parent b9a2c48 commit 9e5bb65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5605,8 +5605,9 @@ Compiler::fgWalkResult Compiler::optVNConstantPropCurStmt(BasicBlock* block, Sta
break;

case GT_LCL_VAR:
case GT_LCL_FLD:
// Make sure the local variable is an R-value.
if ((tree->gtFlags & (GTF_VAR_DEF | GTF_DONT_CSE)))
if ((tree->gtFlags & (GTF_VAR_USEASG | GTF_VAR_DEF | GTF_DONT_CSE)) != GTF_EMPTY)
{
return WALK_CONTINUE;
}
Expand Down

0 comments on commit 9e5bb65

Please sign in to comment.