Skip to content

Fix fgRemoveUnreachableBlocks to detect all changes#57199

Merged
jakobbotsch merged 3 commits intodotnet:mainfrom
jakobbotsch:fix-57061
Aug 12, 2021
Merged

Fix fgRemoveUnreachableBlocks to detect all changes#57199
jakobbotsch merged 3 commits intodotnet:mainfrom
jakobbotsch:fix-57061

Conversation

@jakobbotsch
Copy link
Member

When 'removing' a BBF_DONT_REMOVE block we change it to BBJ_THROW. After
this it is possible that other blocks become unreachable, so we should
keep looking for such blocks.

In #57061 that manifested in a case where the unreachable block did not
have SSA built for it, but downstream the compiler was relying on SSA
being built.

Fix #57061

cc @dotnet/jit-ctontrib

When 'removing' a BBF_DONT_REMOVE block we change it to BBJ_THROW. After
this it is possible that other blocks become unreachable, so we should
keep looking for such blocks.

In dotnet#57061 that manifested in a case where the unreachable block did not
have SSA built for it, but downstream the compiler was relying on SSA
being built.

Fix dotnet#57061
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 11, 2021
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib

@jakobbotsch
Copy link
Member Author

No instruction diffs in x64/x86/ARM32 SPMI, but there are a few GC info diffs because we mark some functions as partially interruptible instead of fully interruptible now.

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also consider ways to harden downstream code so that it does not depend on unreachable blocks being removed.

@jakobbotsch
Copy link
Member Author

I'll merge this now and submit a separate change to harden VN/loop opts for trees that might not have had SSA built for it.

@jakobbotsch jakobbotsch merged commit 70a2a45 into dotnet:main Aug 12, 2021
@jakobbotsch jakobbotsch deleted the fix-57061 branch August 12, 2021 09:09
@ghost ghost locked as resolved and limited conversation to collaborators Sep 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARM32: runtime crash inside JIT

3 participants