Skip to content

Commit

Permalink
JIT: Skip LSRA inserted nodes in gcIsWriteBarrierCandidate
Browse files Browse the repository at this point in the history
gcIsWriteBarrierCandidate is expected to return the same results during
LSRA and during codegen, so it needs to skip GT_COPY and GT_RELOAD
inserted on top of the data node.

Fix dotnet#77141
Fix dotnet#77143
  • Loading branch information
jakobbotsch committed Jan 31, 2023
1 parent dfe1076 commit d656a85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/coreclr/jit/gcinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ GCInfo::WriteBarrierForm GCInfo::gcIsWriteBarrierCandidate(GenTreeStoreInd* stor
}

// Ignore any assignments of NULL.
if ((store->Data()->GetVN(VNK_Liberal) == ValueNumStore::VNForNull()) || store->Data()->IsIntegralConst(0))
GenTree* data = store->Data()->gtSkipReloadOrCopy();
if ((data->GetVN(VNK_Liberal) == ValueNumStore::VNForNull()) || data->IsIntegralConst(0))
{
return WBF_NoBarrier;
}
Expand All @@ -253,7 +254,7 @@ GCInfo::WriteBarrierForm GCInfo::gcIsWriteBarrierCandidate(GenTreeStoreInd* stor
}

// Write-barriers are no-op for frozen objects (as values)
if (store->Data()->IsIconHandle(GTF_ICON_OBJ_HDL))
if (data->IsIconHandle(GTF_ICON_OBJ_HDL))
{
// Ignore frozen objects
return WBF_NoBarrier;
Expand Down

0 comments on commit d656a85

Please sign in to comment.