Skip to content

Commit 9c51d32

Browse files
authored
call gtFoldExpr after fgMorphExpandInstanceField (#103648)
1 parent 7441c8c commit 9c51d32

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/jit/morph.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5110,6 +5110,12 @@ GenTree* Compiler::fgMorphExpandInstanceField(GenTree* tree, MorphAddrContext* m
51105110
{
51115111
addr->SetHasOrderingSideEffect();
51125112
}
5113+
5114+
if (addr->gtGetOp1()->OperIsConst() && addr->gtGetOp2()->OperIsConst())
5115+
{
5116+
// Fold it if we have const-handle + const-offset
5117+
addr = gtFoldExprConst(addr);
5118+
}
51135119
}
51145120

51155121
if (addExplicitNullCheck)

0 commit comments

Comments
 (0)