Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding BBJ_EHFAULTRET #84307

Closed
BruceForstall opened this issue Apr 4, 2023 · 1 comment · Fixed by #84467
Closed

Consider adding BBJ_EHFAULTRET #84307

BruceForstall opened this issue Apr 4, 2023 · 1 comment · Fixed by #84467
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@BruceForstall
Copy link
Member

The IL endfault opcode is an alias for endfinally. The JIT imports this as a BBJ_EHFINALLYRET BasicBlock type. It would be helpful to distinguish the block types so as not to require consulting the EH table when examining the block type to determine which type of EH handler we are in.

So, consider adding a BBJ_EHFAULTRET BasicBlock type and using it for exits from a fault region.

@BruceForstall BruceForstall added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 4, 2023
@BruceForstall BruceForstall added this to the 8.0.0 milestone Apr 4, 2023
@BruceForstall BruceForstall self-assigned this Apr 4, 2023
@ghost
Copy link

ghost commented Apr 4, 2023

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

Issue Details

The IL endfault opcode is an alias for endfinally. The JIT imports this as a BBJ_EHFINALLYRET BasicBlock type. It would be helpful to distinguish the block types so as not to require consulting the EH table when examining the block type to determine which type of EH handler we are in.

So, consider adding a BBJ_EHFAULTRET BasicBlock type and using it for exits from a fault region.

Author: BruceForstall
Assignees: BruceForstall
Labels:

area-CodeGen-coreclr

Milestone: 8.0.0

BruceForstall added a commit to BruceForstall/runtime that referenced this issue Apr 7, 2023
The IL `endfinally` and `endfault` instructions are aliases,
imported in the JIT IR as `BBJ_EHFINALLYRET`.

Introduce `BBJ_EHFAULTRET` for cases within `fault` clauses.

This simplifies some code, and makes it more clear when writing
code that `fault` clauses need to be considered, separately from
`finally` clauses.

To do this, after importing EH clauses, convert any `BBJ_EHFINALLYRET`
as necessary. Also, try/finally cloning, which (sometimes) converts
`finally` clauses to `fault` clauses, needs to update the corresponding
`BBJ_EHFINALLYRET`. When creating new try/fault clauses for synchronized
functions, use `BBJ_EHFAULTRET` now.

Fixes dotnet#84307
BruceForstall added a commit that referenced this issue Apr 7, 2023
The IL `endfinally` and `endfault` instructions are aliases,
imported in the JIT IR as `BBJ_EHFINALLYRET`.

Introduce `BBJ_EHFAULTRET` for cases within `fault` clauses.

This simplifies some code, and makes it more clear when writing
code that `fault` clauses need to be considered, separately from
`finally` clauses.

To do this, after importing EH clauses, convert any `BBJ_EHFINALLYRET`
as necessary. Also, try/finally cloning, which (sometimes) converts
`finally` clauses to `fault` clauses, needs to update the corresponding
`BBJ_EHFINALLYRET`. When creating new try/fault clauses for synchronized
functions, use `BBJ_EHFAULTRET` now.

Fixes #84307
@ghost ghost locked as resolved and limited conversation to collaborators May 8, 2023
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 a pull request may close this issue.

1 participant