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
}
// 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;
}
}
// 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;