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

JIT: Make a quirk in block morphing more explicit #92292

Merged
merged 1 commit into from
Sep 22, 2023
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
10 changes: 7 additions & 3 deletions src/coreclr/jit/morphblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,7 @@ GenTree* MorphCopyBlockHelper::CopyFieldByField()
addrSpillTemp = m_comp->lvaGrabTemp(true DEBUGARG("BlockOp address local"));

LclVarDsc* addrSpillDsc = m_comp->lvaGetDesc(addrSpillTemp);
addrSpillDsc->lvType = addrSpill->TypeIs(TYP_REF) ? TYP_REF : TYP_BYREF; // TODO-ASG: zero-diff quirk, delete.
addrSpillStore = m_comp->gtNewTempStore(addrSpillTemp, addrSpill);
addrSpillStore = m_comp->gtNewTempStore(addrSpillTemp, addrSpill);
}

auto grabAddr = [=, &result](unsigned offs) {
Expand Down Expand Up @@ -1227,7 +1226,12 @@ GenTree* MorphCopyBlockHelper::CopyFieldByField()
// handling.
GenTreeIntCon* fldOffsetNode = m_comp->gtNewIconNode(fullOffs, TYP_I_IMPL);
fldOffsetNode->gtFieldSeq = addrBaseOffsFldSeq;
addrClone = m_comp->gtNewOperNode(GT_ADD, TYP_BYREF, addrClone, fldOffsetNode);
addrClone = m_comp->gtNewOperNode(GT_ADD, varTypeIsGC(addrClone) ? TYP_BYREF : TYP_I_IMPL, addrClone,
fldOffsetNode);
// Avoid constant prop propagating each field access with a large
// constant address. TODO-Cleanup: We should tune constant prop to
// have better heuristics around this.
addrClone->gtFlags |= GTF_DONT_CSE;
}

return addrClone;
Expand Down