Skip to content

Commit 9e5bb65

Browse files
Enable global constant propagation for GT_LCL_FLD (#61209)
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.
1 parent b9a2c48 commit 9e5bb65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/coreclr/jit/assertionprop.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5605,8 +5605,9 @@ Compiler::fgWalkResult Compiler::optVNConstantPropCurStmt(BasicBlock* block, Sta
56055605
break;
56065606

56075607
case GT_LCL_VAR:
5608+
case GT_LCL_FLD:
56085609
// Make sure the local variable is an R-value.
5609-
if ((tree->gtFlags & (GTF_VAR_DEF | GTF_DONT_CSE)))
5610+
if ((tree->gtFlags & (GTF_VAR_USEASG | GTF_VAR_DEF | GTF_DONT_CSE)) != GTF_EMPTY)
56105611
{
56115612
return WALK_CONTINUE;
56125613
}

0 commit comments

Comments
 (0)