Turn unreachable basic blocks into an infinite loop#98319
Turn unreachable basic blocks into an infinite loop#98319MichalStrehovsky merged 4 commits intodotnet:mainfrom
Conversation
Fixes dotnet#97758. There's likely no substitution benefit from that (can't do anything meaningful in 1 byte), but this was causing the above issue: we had a mismatch for some IL patterns where we could optimize uninstantiated method bodies, but couldn't optimize instantiated ones because they ran into the abort at the bottom of this diff.
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsFixes #97758. There's likely no substitution benefit from that (can't do anything meaningful in 1 byte), but this was causing the above issue: we had a mismatch for some IL patterns where we could optimize uninstantiated method bodies, but couldn't optimize instantiated ones because they ran into the abort at the bottom of this diff. Cc @dotnet/ilc-contrib
|
|
Is it worth it to add a test? |
The regression test is quite non-sensical on it's own, but added anyway. |
|
Hm, there's a test that ends up having this IL: We now fail eliminating the part from IL_0027 because 0027 is a branch target and 0028 is a branch target and this logic ends up marking 0027 because it's too short. The test has a point. This substitution code is probably too garbage to fix this. It needs to be rewritten. |
This reverts commit ef8155f.
|
I made a different fix that still avoids doing a rewrite. Instead of padding unreachable basic blocks with nops followed by This now also fixes #81339. |
|
/azp run runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #97758.
Fixes #81339.
Instead of padding unreachable basic blocks with nops followed by
br $-2, we now turn unreachable basic blocks into justbr $-2, no nops (and matching basic block size) needed. This means offsets within the method body can shuffle around and we fix them up.Cc @dotnet/ilc-contrib