Skip to content
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
14 changes: 10 additions & 4 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6259,20 +6259,26 @@ void Lowering::LowerStoreSingleRegCallStruct(GenTreeBlk* store)
// SpillStructCallResult: Spill call result to memory.
//
// Arguments:
// call - call with 3, 5, 6 or 7 return size that has to be spilled to memory.
// call - call returning a struct in a single register whose layout has no primitive register type.
//
// Return Value:
// load of the spilled variable.
//
GenTreeLclVar* Lowering::SpillStructCallResult(GenTreeCall* call) const
{
// TODO-1stClassStructs: we can support this in codegen for `GT_STORE_BLK` without new temps.
const unsigned spillNum = m_compiler->lvaGrabTemp(true DEBUGARG("Return value temp for an odd struct return size"));
const unsigned spillNum =
m_compiler->lvaGrabTemp(true DEBUGARG("Return value temp for a non-enregisterable struct return"));
m_compiler->lvaSetVarDoNotEnregister(spillNum DEBUGARG(DoNotEnregisterReason::LocalField));
CORINFO_CLASS_HANDLE retClsHnd = call->gtRetClsHnd;
m_compiler->lvaSetStruct(spillNum, retClsHnd, false);
unsigned offset = call->GetReturnTypeDesc()->GetSingleReturnFieldOffset();
GenTreeLclFld* spill = m_compiler->gtNewStoreLclFldNode(spillNum, call->TypeGet(), offset, call);
#if FEATURE_MULTIREG_RET
unsigned offset = call->GetReturnTypeDesc()->GetSingleReturnFieldOffset();
#else
// No ReturnTypeDesc without FEATURE_MULTIREG_RET.
unsigned offset = 0;
#endif
GenTreeLclFld* spill = m_compiler->gtNewStoreLclFldNode(spillNum, call->TypeGet(), offset, call);

BlockRange().InsertAfter(call, spill);
ContainCheckStoreLoc(spill);
Expand Down
Loading