Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
[OPT] Enable implicit byref struct promotion
Browse files Browse the repository at this point in the history
Back off a bit on register pressure
  • Loading branch information
JosephTremoulet committed Apr 26, 2017
1 parent e0115fe commit e3b2862
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17739,13 +17739,6 @@ void Compiler::fgReMarkImplicitByRefArgs()
size = info.compCompHnd->getClassSize(typeHnd);
}

// Temporary change to make reordering no-diff: mark any promoted implicit-by-ref args
// dependent promotions, by marking them address-taken
if (varDsc->lvPromoted)
{
lvaSetVarAddrExposed(lclNum);
}

if (varDsc->lvPromoted)
{
// This implicit-by-ref was promoted; create a new temp to represent the
Expand Down Expand Up @@ -17782,7 +17775,8 @@ void Compiler::fgReMarkImplicitByRefArgs()
// through the pointer parameter, the same as we'd do for this
// parameter if it weren't promoted at all (otherwise the initialization
// of the new temp would just be a needless memcpy at method entry.
bool undoPromotion = lvaGetPromotionType(newVarDsc) == PROMOTION_TYPE_DEPENDENT;
bool undoPromotion = (lvaGetPromotionType(newVarDsc) == PROMOTION_TYPE_DEPENDENT) ||
(varDsc->lvRefCnt <= varDsc->lvFieldCnt);

if (!undoPromotion)
{
Expand Down

0 comments on commit e3b2862

Please sign in to comment.