Skip to content

Commit

Permalink
Do not enregister EH Var that has single use
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak committed Mar 4, 2021
1 parent aff80de commit 24b0af6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2615,15 +2615,15 @@ void Compiler::lvaSetVarLiveInOutOfHandler(unsigned varNum)
noway_assert(lvaTable[i].lvIsStructField);
lvaTable[i].lvLiveInOutOfHndlr = 1;
// For now, only enregister an EH Var if it is a single def.
if (!lvaEnregEHVars || !lvaTable[i].lvEhWriteThruCandidate)
if (!lvaEnregEHVars || !lvaTable[i].lvEhWriteThruCandidate || lvaTable[i].lvRefCnt() <= 1)
{
lvaSetVarDoNotEnregister(i DEBUGARG(DNER_LiveInOutOfHandler));
}
}
}

// For now, only enregister an EH Var if it is a single def.
if (!lvaEnregEHVars || !varDsc->lvEhWriteThruCandidate)
if (!lvaEnregEHVars || !varDsc->lvEhWriteThruCandidate || varDsc->lvRefCnt() <= 1)
{
lvaSetVarDoNotEnregister(varNum DEBUGARG(DNER_LiveInOutOfHandler));
}
Expand Down
11 changes: 0 additions & 11 deletions src/coreclr/jit/lsra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1783,17 +1783,6 @@ void LinearScan::identifyCandidates()
if (varDsc->lvLiveInOutOfHndlr)
{
newInt->isWriteThru = varDsc->lvEhWriteThruCandidate;
#ifdef DEBUG
if (newInt->isWriteThru)
{
JITDUMP("Marking Interal %d as writeThru because V%02u is a single def.\n", newInt->intervalIndex, lclNum);
}
else
{
JITDUMP("Skipping Interal %d as writeThru because V%02u is not a single def.\n",
newInt->intervalIndex, lclNum);
}
#endif
setIntervalAsSpilled(newInt);
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/scripts/superpmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ def replay_with_asm_diffs(self):
"COMPlus_JitDiffableDasm": "1",
"COMPlus_JitEnableNoWayAssert": "1",
"COMPlus_JitNoForceFallback": "1",
"COMPlus_JitDisasmWithGC": "1" }
"COMPlus_JitDisasmWithGC": "0" }

if self.coreclr_args.gcinfo:
asm_complus_vars.update({
Expand Down

0 comments on commit 24b0af6

Please sign in to comment.