Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make gcunsafe for cpblk if it has gc pointers #70053

Merged
merged 1 commit into from
Jun 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions src/coreclr/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2801,22 +2801,13 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node)
CopyBlockUnrollHelper helper(srcOffset, dstOffset, size);
regNumber srcReg = srcAddrBaseReg;

#ifdef DEBUG
bool isSrcRegAddrAlignmentKnown = false;
bool isDstRegAddrAlignmentKnown = false;
#endif

if (srcLclNum != BAD_VAR_NUM)
{
bool fpBased;
const int baseAddr = compiler->lvaFrameAddress(srcLclNum, &fpBased);

srcReg = fpBased ? REG_FPBASE : REG_SPBASE;
helper.SetSrcOffset(baseAddr + srcOffset);

#ifdef DEBUG
isSrcRegAddrAlignmentKnown = true;
#endif
}

regNumber dstReg = dstAddrBaseReg;
Expand All @@ -2828,10 +2819,6 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node)

dstReg = fpBased ? REG_FPBASE : REG_SPBASE;
helper.SetDstOffset(baseAddr + dstOffset);

#ifdef DEBUG
isDstRegAddrAlignmentKnown = true;
#endif
}

bool canEncodeAllLoads = true;
Expand Down Expand Up @@ -2945,8 +2932,8 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node)
}
#endif

#ifndef JIT32_GCENCODER
if (!node->gtBlkOpGcUnsafe && ((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0)))
if (!node->gtBlkOpGcUnsafe &&
((srcOffsetAdjustment != 0) || (dstOffsetAdjustment != 0) || (node->GetLayout()->HasGCPtr())))
{
// 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 All @@ -2955,7 +2942,6 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node)
node->gtBlkOpGcUnsafe = true;
GetEmitter()->emitDisableGC();
}
#endif

if ((srcOffsetAdjustment != 0) && (dstOffsetAdjustment != 0))
{
Expand Down