Skip to content

Commit 0010000

Browse files
AndyAyersMSpull[bot]
authored andcommitted
JIT: remove some unnecessary DONT_REMOVE block flags (#108405)
When we clone a finally or remove an empty try, the cloned handler entry or former try region entry no longer need special protection.
1 parent 08b853c commit 0010000

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/jit/fgehopt.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ PhaseStatus Compiler::fgRemoveEmptyFinally()
223223
// so XTnum now points at the next entry.
224224
fgRemoveEHTableEntry(XTnum);
225225

226+
// First block of the former try no longer needs special protection.
227+
firstTryBlock->RemoveFlags(BBF_DONT_REMOVE);
228+
226229
emptyCount++;
227230
}
228231

@@ -1056,6 +1059,9 @@ PhaseStatus Compiler::fgCloneFinally()
10561059
{
10571060
// Mark the block as the start of the cloned finally.
10581061
newBlock->SetFlags(BBF_CLONED_FINALLY_BEGIN);
1062+
1063+
// Cloned finally entry block does not need any special protection.
1064+
newBlock->RemoveFlags(BBF_DONT_REMOVE);
10591065
}
10601066

10611067
if (block == lastBlock)

0 commit comments

Comments
 (0)