Skip to content

Commit

Permalink
don't init tracked temps without GC fields. (#49879)
Browse files Browse the repository at this point in the history
The diffs are in D:\Sergey\logs\diff.liveness.txt
  • Loading branch information
Sergey Andreenko authored Mar 19, 2021
1 parent 57d35a9 commit f7d83ab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4682,6 +4682,12 @@ void CodeGen::genCheckUseBlockInit()
continue;
}

if (varDsc->lvIsTemp && !varDsc->HasGCPtr())
{
varDsc->lvMustInit = 0;
continue;
}

if (compiler->info.compInitMem || varDsc->HasGCPtr() || varDsc->lvMustInit)
{
if (varDsc->lvTracked)
Expand Down Expand Up @@ -4728,8 +4734,7 @@ void CodeGen::genCheckUseBlockInit()
unless they are untracked GC type or structs that contain GC pointers */
CLANG_FORMAT_COMMENT_ANCHOR;

if ((!varDsc->lvTracked || (varDsc->lvType == TYP_STRUCT)) && varDsc->lvOnFrame &&
(!varDsc->lvIsTemp || varDsc->HasGCPtr()))
if ((!varDsc->lvTracked || (varDsc->lvType == TYP_STRUCT)) && varDsc->lvOnFrame)
{

varDsc->lvMustInit = true;
Expand Down

0 comments on commit f7d83ab

Please sign in to comment.