Skip to content

Conversation

@AndyAyersMS
Copy link
Member

Basically the same transformation we just started doing for try/catch also works for try/fault, so just broaden the set of cases, and rename a few things.

Basically the same transformation we just started doing for try/catch
also works for try/fault, so just broaden the set of cases, and rename
a few things.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 6, 2024
@dotnet-policy-service
Copy link
Contributor

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

@AndyAyersMS
Copy link
Member Author

@amanasifkhalid PTAL
cc @dotnet/jit-contrib

I was going to handle this by enhancing the try-finally case, but realized that try-catch removal already does the right things. Looks like there are a modest number of diffs.

#110273 (comment)

@AndyAyersMS
Copy link
Member Author

The repro case from the above is now

IN0004: 000000 push     rbp
IN0005: 000001 sub      rsp, 32
IN0006: 000005 lea      rbp, [rsp+0x20]

G_M9330_IG02:        ; offs=0x00000A, size=0x000C, bbWeight=1, PerfScore 3.50, gcrefRegs=0000 {}, byrefRegs=0000 {}, BB01 [0000], byref

IN0001: 00000A mov      ecx, 56
IN0002: 00000F call     [System.Console:WriteLine(int)]
IN0003: 000015 nop      

G_M9330_IG03:        ; offs=0x000016, size=0x0006, bbWeight=1, PerfScore 1.75, epilog, nogc, extend

IN0007: 000016 add      rsp, 32
IN0008: 00001A pop      rbp
IN0009: 00001B ret  

You will note we don't tail call... we currently must identify tail call candidates fairly early, before we've removed the EH, so we miss this one. Seems like we ought to be able to fix that too, but will leave that for a future PR.

@AndyAyersMS AndyAyersMS merged commit e7e568b into dotnet:main Dec 6, 2024
105 of 108 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2025
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.

2 participants