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

JIT: enable one particular flow opt when we have PGO #84875

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

AndyAyersMS
Copy link
Member

This particular optimization seems to be a good idea, so not sure why the code was unwilling to do it if we had profile data.

This optimization removes a "branch around":

BlockA: jtrue (p) BlockC
BlockB: {empty} jmp BlockD
BlockC: ...
...
BlockD: ...

becomes

BlockA: jtrue (!p) BlockD
BlockC: ...
...
BlockD: ...

If later during code layout we decide we'd rather have

BlockA: jtrue (p) BlockC
BlockD: ...
...
BlockC: ...

we can still make that happen.

This particular optimization seems to be a good idea, so not sure why
the code was unwilling to do it if we had profile data.

This optimization removes a "branch around":

``
BlockA: jtrue (p) BlockC
BlockB: {empty} jmp BlockD
BlockC: ...
...
BlockD: ...
```
becomes

```
BlockA: jtrue (!p) BlockD
BlockC: ...
...
BlockD: ...
```

If later during code layout we decide we'd rather have
```
BlockA: jtrue (p) BlockC
BlockD: ...
...
BlockC: ...
```
we can still make that happen.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 15, 2023
@ghost ghost assigned AndyAyersMS Apr 15, 2023
@ghost
Copy link

ghost commented Apr 15, 2023

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

Issue Details

This particular optimization seems to be a good idea, so not sure why the code was unwilling to do it if we had profile data.

This optimization removes a "branch around":

BlockA: jtrue (p) BlockC
BlockB: {empty} jmp BlockD
BlockC: ...
...
BlockD: ...

becomes

BlockA: jtrue (!p) BlockD
BlockC: ...
...
BlockD: ...

If later during code layout we decide we'd rather have

BlockA: jtrue (p) BlockC
BlockD: ...
...
BlockC: ...

we can still make that happen.

Author: AndyAyersMS
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

@EgorBo PTAL
cc @dotnet/jit-contrib

Expect modest diffs in PGO collections. Fixes some cases where the method epilog was appearing after a bunch of throw blocks.

@AndyAyersMS AndyAyersMS requested a review from EgorBo April 15, 2023 02:39
@EgorBo
Copy link
Member

EgorBo commented Apr 15, 2023

Diffs

@AndyAyersMS AndyAyersMS merged commit 90f8078 into dotnet:main Apr 15, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 16, 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 this pull request may close these issues.

2 participants