Skip to content

Enable UMOD optimization for x64 - #68091

Merged
TIHan merged 1 commit into
dotnet:mainfrom
TIHan:umod-opt-x64-enable
May 11, 2022
Merged

Enable UMOD optimization for x64#68091
TIHan merged 1 commit into
dotnet:mainfrom
TIHan:umod-opt-x64-enable

Conversation

@TIHan

@TIHan TIHan commented Apr 15, 2022

Copy link
Copy Markdown
Contributor

Description

We added an optimization for GT_UMOD in ARM64. This PR enables the same optimization for x64.

Acceptance Criteria

  • Passes CI
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 15, 2022
@ghost ghost assigned TIHan Apr 15, 2022
@ghost

ghost commented Apr 15, 2022

Copy link
Copy Markdown

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

Issue Details

Description

We added an optimization for GT_UMOD in ARM64. This PR enables the same optimization for x64.

Acceptance Criteria

  • Passes CI
Author: TIHan
Assignees: TIHan
Labels:

area-CodeGen-coreclr

Milestone: -
@TIHan

TIHan commented Apr 16, 2022

Copy link
Copy Markdown
Contributor Author

@kunalspathak @jakobbotsch This is ready.

This is a trivial change and the diffs look good; though there are not very many of them.

@kunalspathak

Copy link
Copy Markdown
Contributor

though there are not very many of them.

Do you know why? I am asking to make sure that we know if these changes are good enough to catch the scenarios or did we miss something.

@kunalspathak

Copy link
Copy Markdown
Contributor

You can probably take some methods that were improved in arm64 work and not in x64 and then compare what make us generate differently?

@TIHan

TIHan commented Apr 18, 2022

Copy link
Copy Markdown
Contributor Author

I think the reason is that this optimization also happens in lowering for x64 where as for ARM64 it does not: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/lower.cpp#L5556

@kunalspathak

Copy link
Copy Markdown
Contributor

I think the reason is that this optimization also happens in lowering for x64 where as for ARM64 it does not: https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/lower.cpp#L5556

So we were covering x64 but just missed few opportunities that we are also covering with this PR. Is that the case? Wonder what prohibited us from covering those scenarios in x64 prior to your PR.

@TIHan

TIHan commented Apr 21, 2022

Copy link
Copy Markdown
Contributor Author

So we were covering x64 but just missed few opportunities that we are also covering with this PR. Is that the case?

That was my thinking. It's similar to SubMulDiv optimization for 'mod' since that exists in both morph and lowering.

Wonder what prohibited us from covering those scenarios in x64 prior to your PR.

Probably just low hanging fruit.

@TIHan

TIHan commented May 11, 2022

Copy link
Copy Markdown
Contributor Author

@kunalspathak is there anything that needs to be done in this PR?

@kunalspathak kunalspathak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Sorry, I forgot to sign off.

@TIHan

TIHan commented May 11, 2022

Copy link
Copy Markdown
Contributor Author

No worries thank you! :)

@TIHan
TIHan merged commit 5975649 into dotnet:main May 11, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 11, 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

2 participants