JIT: Restore EH-region check in if-conversion flow validation#127450
JIT: Restore EH-region check in if-conversion flow validation#127450
Conversation
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/0bd5867d-f0f1-48fe-a41d-6c34a0fb3100 Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com>
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
Maybe I should just directly check for |
|
@copilot please delete |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/275ca4c6-c08d-4515-8216-d36ca86693be Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com>
Done in 1a10c80 — removed Note This reply was AI-generated by GitHub Copilot. |
A Fuzzlyn-generated repro hits
assert(!block->HasFlag(BBF_DONT_REMOVE))during the JIT's If conversion phase when the Then block is the start of a try region. Bisected to dea4756 (#125347), which simplifiedIfConvertCheckFlowand inadvertently dropped theBasicBlock::sameEHRegioncheck previously performed byIfConvertCheckInnerBlockFlow. Without it, if-conversion proceeds on a Then/Else block that begins an EH region, then trips the assert when later removing it.Changes
src/coreclr/jit/ifconversion.cpp— InOptIfConversionDsc::IfConvertCheckFlow, bail whenfalseBb(Then) ortrueBb(Else, when present) is not in the same EH region asm_startBlock.src/tests/JIT/Regression/JitBlue/Runtime_127446/Runtime_127446.cs— Regression test using the original repro. The test source is added to the shared mergedsrc/tests/JIT/Regression/Regression_o_3.csproj(alongside other JitBlue regression tests); no per-test csproj or environment variables are needed.Verified the assert reproduces on the unfixed JIT and is gone with the fix; the new test passes through the merged test runner (
global::Runtime_127446.Runtime_127446.TestEntryPoint()→ Passed).