Skip to content

Commit fdb68dd

Browse files
authored
JIT: remove is rare check from finally cloning (#110483)
There are currently few rarely run finallys, so stop checking for them. Future changes may introduce some, and cloning them can be beneficial to nearby hot code.
1 parent fa451cf commit fdb68dd

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/coreclr/jit/fgehopt.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,6 @@ PhaseStatus Compiler::fgCloneFinally()
11941194
unsigned regionBBCount = 0;
11951195
unsigned regionStmtCount = 0;
11961196
bool hasFinallyRet = false;
1197-
bool isAllRare = true;
11981197
bool hasSwitch = false;
11991198

12001199
for (BasicBlock* const block : Blocks(firstBlock, lastBlock))
@@ -1215,7 +1214,6 @@ PhaseStatus Compiler::fgCloneFinally()
12151214
}
12161215

12171216
hasFinallyRet = hasFinallyRet || block->KindIs(BBJ_EHFINALLYRET);
1218-
isAllRare = isAllRare && block->isRunRarely();
12191217
}
12201218

12211219
// Skip cloning if the finally has a switch.
@@ -1232,13 +1230,6 @@ PhaseStatus Compiler::fgCloneFinally()
12321230
continue;
12331231
}
12341232

1235-
// Skip cloning if the finally is rarely run code.
1236-
if (isAllRare)
1237-
{
1238-
JITDUMP("Finally in EH#%u is run rarely; skipping.\n", XTnum);
1239-
continue;
1240-
}
1241-
12421233
// Empirical studies from CoreCLR and CoreFX show that less
12431234
// that 1% of finally regions have more than 15
12441235
// statements. So, to avoid potentially excessive code growth,

0 commit comments

Comments
 (0)