Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix the undone struct promotion for return
  • Loading branch information
kunalspathak authored and github-actions committed Sep 3, 2021
commit 8712e19d0780e98583a20814135a717c4c3359c9
9 changes: 9 additions & 0 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13997,6 +13997,15 @@ GenTree* Compiler::fgMorphRetInd(GenTreeUnOp* ret)

if (addr->OperIs(GT_ADDR) && addr->gtGetOp1()->OperIs(GT_LCL_VAR))
{
if (fgGlobalMorph)
{
// If struct promotion was undone, adjust the annotations
if(fgMorphImplicitByRefArgs(addr))
{
return ind;
}
}

// If `return` retypes LCL_VAR as a smaller struct it should not set `doNotEnregister` on that
// LclVar.
// Example: in `Vector128:AsVector2` we have RETURN SIMD8(OBJ SIMD8(ADDR byref(LCL_VAR SIMD16))).
Expand Down