Skip to content

Fix loop canonicalization for call-finally case#76734

Merged
BruceForstall merged 2 commits intodotnet:mainfrom
BruceForstall:FixLoopCanonicalization2
Oct 11, 2022
Merged

Fix loop canonicalization for call-finally case#76734
BruceForstall merged 2 commits intodotnet:mainfrom
BruceForstall:FixLoopCanonicalization2

Conversation

@BruceForstall
Copy link
Contributor

If a call-finally is followed by a loop body that requires canonicalization, we hit an assert that the head block preceding the loop must be a fall-through block. This was true in all cases except if the preceding block was the BBJ_ALWAYS of a BBJ_CALLFINALLY/BBJ_ALWAYS pair.

To fix this, add a new canonicalization. If this case occurs, simply insert a new fall-through block above the loop top and redirect the BBJ_ALWAYS to that new block.

Fixes #76346

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 7, 2022
@ghost ghost assigned BruceForstall Oct 7, 2022
@BruceForstall
Copy link
Contributor Author

I saw no asm diffs locally.

@ghost
Copy link

ghost commented Oct 7, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

If a call-finally is followed by a loop body that requires canonicalization, we hit an assert that the head block preceding the loop must be a fall-through block. This was true in all cases except if the preceding block was the BBJ_ALWAYS of a BBJ_CALLFINALLY/BBJ_ALWAYS pair.

To fix this, add a new canonicalization. If this case occurs, simply insert a new fall-through block above the loop top and redirect the BBJ_ALWAYS to that new block.

Fixes #76346

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall
Copy link
Contributor Author

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@BruceForstall
Copy link
Contributor Author

@AndyAyersMS @dotnet/jit-contrib PTAL

@JulieLeeMSFT JulieLeeMSFT added this to the 8.0.0 milestone Oct 10, 2022
If a call-finally is followed by a loop body that requires
canonicalization, we hit an assert that the `head` block
preceding the loop must be a fall-through block. This was
true in all cases except if the preceding block was the
BBJ_ALWAYS of a BBJ_CALLFINALLY/BBJ_ALWAYS pair.

To fix this, add a new canonicalization. If this case occurs,
simply insert a new fall-through block above the loop top
and redirect the BBJ_ALWAYS to that new block.

Fixes dotnet#76346
@BruceForstall BruceForstall force-pushed the FixLoopCanonicalization2 branch from 744943e to 9e8fabc Compare October 10, 2022 23:22
@build-analysis build-analysis bot mentioned this pull request Oct 11, 2022
2 tasks
@BruceForstall BruceForstall merged commit 3435b39 into dotnet:main Oct 11, 2022
@BruceForstall BruceForstall deleted the FixLoopCanonicalization2 branch October 11, 2022 06:23
@ghost ghost locked as resolved and limited conversation to collaborators Nov 10, 2022
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.

Assertion failed 'h->bbFallsThrough()'

3 participants