Skip to content

Commit

Permalink
JIT: Skip LSRA inserted nodes in gcIsWriteBarrierCandidate (#81423)
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 #77141
Fix #77143
  • Loading branch information
jakobbotsch committed Jan 31, 2023
1 parent d7d154d commit bda8c8d
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 bda8c8d

Please sign in to comment.