Skip to content

Commit

Permalink
JIT: Move cpblk GC ref layout check back to lowering
Browse files Browse the repository at this point in the history
The check in codegen runs only for arm64 but this check needs to happen
for arm32 as well. This moves the GC ref layout check back to lowering
and aligns it with xarch as well.

Fix dotnet#69976
  • Loading branch information
jakobbotsch committed Jul 20, 2022
1 parent 47974ff commit 2267af5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2858,8 +2858,7 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node)
}
#endif

if (!node->gtBlkOpGcUnsafe &&
((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0) || (node->GetLayout()->HasGCPtr())))
if (!node->gtBlkOpGcUnsafe && ((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0)))
{
// If node is not already marked as non-interruptible, and if are about to generate code
// that produce GC references in temporary registers not reported, then mark the block
Expand Down
7 changes: 6 additions & 1 deletion src/coreclr/jit/lowerarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,15 @@ void Lowering::LowerBlockStore(GenTreeBlk* blkNode)

if (blkNode->OperIs(GT_STORE_OBJ))
{
if (!blkNode->AsObj()->GetLayout()->HasGCPtr() || (isDstAddrLocal && (size <= copyBlockUnrollLimit)))
if (!blkNode->AsObj()->GetLayout()->HasGCPtr())
{
blkNode->SetOper(GT_STORE_BLK);
}
else if (isDstAddrLocal && (size <= copyBlockUnrollLimit))
{
blkNode->SetOper(GT_STORE_BLK);
blkNode->gtBlkOpGcUnsafe = true;
}
}

if (blkNode->OperIs(GT_STORE_OBJ))
Expand Down

0 comments on commit 2267af5

Please sign in to comment.