Skip to content

Commit f3d43ef

Browse files
JIT: Don't move EH region entries when aligning backward jumps (#110918)
Follow-up to #110277. Fixes #110756. Don't consider 4-opt cut points that would move the entry block of a try/handler region below other blocks in the region. Previously, either future moves would put the entry block back at the top of the region, or we would get unlucky in the rare case and hit asserts.
1 parent bdf1143 commit f3d43ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/coreclr/jit/fgopt.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5456,6 +5456,12 @@ bool Compiler::ThreeOptLayout::RunGreedyThreeOptPass(unsigned startPos, unsigned
54565456
continue;
54575457
}
54585458

5459+
// Don't consider any cut points that would move try/handler entries
5460+
if (compiler->bbIsTryBeg(s3BlockPrev) || compiler->bbIsHandlerBeg(s3BlockPrev))
5461+
{
5462+
continue;
5463+
}
5464+
54595465
// Compute the cost delta of this partition
54605466
const weight_t currCost = currCostBase + GetCost(s3BlockPrev, s3Block);
54615467
const weight_t newCost =

0 commit comments

Comments
 (0)