Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak committed May 4, 2023
1 parent e4f20c0 commit 32b9a30
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 30 deletions.
22 changes: 10 additions & 12 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,14 @@ PhaseStatus LinearScan::doLinearScan()
nextConsecutiveRefPositionMap = nullptr;
#endif

buildIntervals();
if (enregisterLocalVars)
{
buildIntervals<true>();
}
else
{
buildIntervals<false>();
}

DBEXEC(VERBOSE, TupleStyleDump(LSRA_DUMP_REFPOS));
compiler->EndPhase(PHASE_LINEAR_SCAN_BUILD);
Expand Down Expand Up @@ -1650,17 +1657,8 @@ bool LinearScan::isRegCandidate(LclVarDsc* varDsc)
return true;
}

void LinearScan::identifyCandidates()
{
if (enregisterLocalVars)
{
identifyCandidates<true>();
}
else
{
identifyCandidates<false>();
}
}
template void LinearScan::identifyCandidates<true>();
template void LinearScan::identifyCandidates<false>();

// Identify locals & compiler temps that are register candidates
// TODO-Cleanup: This was cloned from Compiler::lvaSortByRefCount() in lclvars.cpp in order
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/jit/lsra.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,6 @@ class LinearScan : public LinearScanInterface
// This does the dataflow analysis and builds the intervals
template <bool localVarsEnregistered>
void buildIntervals();
void buildIntervals();

// This is where the actual assignment is done
#ifdef TARGET_ARM64
Expand Down Expand Up @@ -990,7 +989,6 @@ class LinearScan : public LinearScanInterface
// Determine which locals are candidates for allocation
template <bool localVarsEnregistered>
void identifyCandidates();
void identifyCandidates();

// determine which locals are used in EH constructs we don't want to deal with
void identifyCandidatesExceptionDataflow();
Expand Down
19 changes: 3 additions & 16 deletions src/coreclr/jit/lsrabuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2126,21 +2126,8 @@ void LinearScan::updateRegStateForArg(LclVarDsc* argDsc)
}
}

//------------------------------------------------------------------------
// buildIntervals: The main entry point for building the data structures over
// which we will do register allocation.
//
void LinearScan::buildIntervals()
{
if (enregisterLocalVars)
{
buildIntervals<true>();
}
else
{
buildIntervals<false>();
}
}
template void LinearScan::buildIntervals<true>();
template void LinearScan::buildIntervals<false>();

//------------------------------------------------------------------------
// buildIntervals: The main entry point for building the data structures over
Expand Down Expand Up @@ -2185,7 +2172,7 @@ void LinearScan::buildIntervals()
doDoubleAlign = false;
#endif

identifyCandidates();
identifyCandidates<localVarsEnregistered>();

// Figure out if we're going to use a frame pointer. We need to do this before building
// the ref positions, because those objects will embed the frame register in various register masks
Expand Down

0 comments on commit 32b9a30

Please sign in to comment.