Skip to content

Commit

Permalink
JIT: remove some unnecessary DONT_REMOVE block flags (#108405)
Browse files Browse the repository at this point in the history
When we clone a finally or remove an empty try, the cloned handler
entry or former try region entry no longer need special protection.
  • Loading branch information
AndyAyersMS authored Sep 30, 2024
1 parent a0790e9 commit 7b1e788
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/coreclr/jit/fgehopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ PhaseStatus Compiler::fgRemoveEmptyFinally()
// so XTnum now points at the next entry.
fgRemoveEHTableEntry(XTnum);

// First block of the former try no longer needs special protection.
firstTryBlock->RemoveFlags(BBF_DONT_REMOVE);

emptyCount++;
}

Expand Down Expand Up @@ -1056,6 +1059,9 @@ PhaseStatus Compiler::fgCloneFinally()
{
// Mark the block as the start of the cloned finally.
newBlock->SetFlags(BBF_CLONED_FINALLY_BEGIN);

// Cloned finally entry block does not need any special protection.
newBlock->RemoveFlags(BBF_DONT_REMOVE);
}

if (block == lastBlock)
Expand Down

0 comments on commit 7b1e788

Please sign in to comment.