From dbd8f06f9de1b92286901b2bc92b1ce94776352e Mon Sep 17 00:00:00 2001 From: "Aman Khalid (from Dev Box)" Date: Mon, 20 Jan 2025 15:04:51 -0500 Subject: [PATCH] Don't let 4-opt mess up EH regions --- src/coreclr/jit/fgopt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp index ccd1a24098c3aa..d2f9db28b07912 100644 --- a/src/coreclr/jit/fgopt.cpp +++ b/src/coreclr/jit/fgopt.cpp @@ -5482,8 +5482,8 @@ bool Compiler::ThreeOptLayout::RunGreedyThreeOptPass(unsigned startPos, unsigned continue; } - // Don't consider any cut points that would move try/handler entries - if (compiler->bbIsTryBeg(s3BlockPrev) || compiler->bbIsHandlerBeg(s3BlockPrev)) + // Don't consider any cut points that would disturb other EH regions + if (!BasicBlock::sameEHRegion(s2Block, s3Block)) { continue; }