Skip to content

Commit a76b7fc

Browse files
committed
Make it less conservative
1 parent 9a2d683 commit a76b7fc

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/coreclr/jit/compiler.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12351,9 +12351,21 @@ inline LoopDefinitions::LocalDefinitionsMap* LoopDefinitions::GetOrCreateMap(Flo
1235112351
fgWalkResult PreOrderVisit(GenTree** use, GenTree* user)
1235212352
{
1235312353
GenTreeLclVarCommon* lcl = (*use)->AsLclVarCommon();
12354-
if (!lcl->OperIsLocalStore() && (!m_optForCrossBlock || !lcl->OperIs(GT_LCL_ADDR)))
12354+
12355+
if (m_optForCrossBlock)
12356+
{
12357+
if (!lcl->OperIsLocalStore() &&
12358+
!(lcl->OperIs(GT_LCL_ADDR) && m_compiler->gtNodeHasSideEffects(user, GTF_PERSISTENT_SIDE_EFFECTS)))
12359+
{
12360+
return Compiler::WALK_CONTINUE;
12361+
}
12362+
}
12363+
else
1235512364
{
12356-
return Compiler::WALK_CONTINUE;
12365+
if (!lcl->OperIsLocalStore())
12366+
{
12367+
return Compiler::WALK_CONTINUE;
12368+
}
1235712369
}
1235812370

1235912371
m_map->Set(lcl->GetLclNum(), true, LocalDefinitionsMap::Overwrite);

0 commit comments

Comments
 (0)