Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6152,8 +6152,6 @@ class Compiler

bool fgExpandRarelyRunBlocks();

bool fgEhAllowsMoveBlock(BasicBlock* bBefore, BasicBlock* bAfter);

void fgMoveBlocksAfter(BasicBlock* bStart, BasicBlock* bEnd, BasicBlock* insertAfterBlk);

PhaseStatus fgHeadTailMerge(bool early);
Expand Down
12 changes: 0 additions & 12 deletions src/coreclr/jit/fgbasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5309,18 +5309,6 @@ bool Compiler::fgIsForwardBranch(BasicBlock* bJump, BasicBlock* bDest, BasicBloc
return result;
}

/*****************************************************************************
*
* Returns true if it is allowable (based upon the EH regions)
* to place block bAfter immediately after bBefore. It is allowable
* if the 'bBefore' and 'bAfter' blocks are in the exact same EH region.
*/

bool Compiler::fgEhAllowsMoveBlock(BasicBlock* bBefore, BasicBlock* bAfter)
{
return BasicBlock::sameEHRegion(bBefore, bAfter);
}

/*****************************************************************************
*
* Function called to move the range of blocks [bStart .. bEnd].
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/jit/fgopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4517,8 +4517,10 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
{
// In the join free case, we also need to move bDest right after bNext
// to create same flow as in the isJumpAroundEmpty case.
// However, we cannot move bDest if it will break EH invariants.
//
if (!fgEhAllowsMoveBlock(bNext, bDest) || bDest->isBBCallFinallyPair())
if (!BasicBlock::sameEHRegion(bNext, bDest) || bbIsTryBeg(bDest) || bbIsHandlerBeg(bDest) ||
bDest->isBBCallFinallyPair())
{
optimizeJump = false;
}
Expand Down
Loading