Skip to content

Commit

Permalink
Add quick early-out that avoids IR walk of first BB
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobbotsch committed Dec 26, 2024
1 parent 9a23ca3 commit 8a6edaf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/coreclr/jit/lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7995,6 +7995,32 @@ void Lowering::MapParameterRegisterLocals()
//
void Lowering::FindInducedParameterRegisterLocals()
{
// Check if we possibly have any parameters we can induce new register
// locals from.
bool anyCandidates = false;
for (unsigned lclNum = 0; lclNum < comp->info.compArgsCount; lclNum++)
{
LclVarDsc* lcl = comp->lvaGetDesc(lclNum);
if (lcl->lvPromoted || !lcl->lvDoNotEnregister)
{
continue;
}

const ABIPassingInformation& abiInfo = comp->lvaGetParameterABIInfo(lclNum);
if (!abiInfo.HasAnyRegisterSegment())
{
continue;
}

anyCandidates = true;
break;
}

if (!anyCandidates)
{
return;
}

LocalSet storedToLocals(comp->getAllocator(CMK_ABI));
// Now look for optimization opportunities in the first block: places where
// we read fields out of struct parameters that can be mapped cleanly. This
Expand Down

0 comments on commit 8a6edaf

Please sign in to comment.