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: Optimize simple MUL/DIV arithmetic with GT_NEG #44375

Closed
JulieLeeMSFT opened this issue Nov 7, 2020 · 6 comments
Closed

JIT: Optimize simple MUL/DIV arithmetic with GT_NEG #44375

JulieLeeMSFT opened this issue Nov 7, 2020 · 6 comments
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI help wanted [up-for-grabs] Good issue for external contributors optimization
Milestone

Comments

@JulieLeeMSFT
Copy link
Member

This is part 2 of #13837 to optimize multiplication and division arithmetic optimizations with GT_NEG.
Addition and subtraction have been completed in PR #43921.

int M5(int a) =>  -a / 10;  // optimize to  "a / -10"
int M6(int a) => -(a / 10); // optimize to  "a / -10"
int M7(int a) =>  -a * 10;  // optimize to  "a * -10"
int M8(int a) => -(a * 10); // optimize to  "a * -10"

category:cq
theme:basic-cq
skill-level:beginner
cost:small

@JulieLeeMSFT JulieLeeMSFT added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI optimization labels Nov 7, 2020
@JulieLeeMSFT JulieLeeMSFT added this to the Future milestone Nov 7, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 7, 2020
@JulieLeeMSFT JulieLeeMSFT added help wanted [up-for-grabs] Good issue for external contributors and removed untriaged New issue has not been triaged by the area owner labels Nov 7, 2020
@EgorBo
Copy link
Member

EgorBo commented Nov 7, 2020

A small note: 10 -> -10 should not be done for IconHandle constant (#44266)

@alexcovington
Copy link
Contributor

@JulieLeeMSFT This seems like a good introductory issue to get familiar with the JIT, which I've been looking for. Would you be able to assign this to me?

@danmoseley
Copy link
Member

@alexcovington is this issue now completed? If so we can close it.

perhaps there's another issue that's interesting among our codegen issues up for grabs: https://github.com/dotnet/runtime/issues?q=is%3Aopen+label%3Aup-for-grabs+label%3Aarea-CodeGen-coreclr+

@alexcovington
Copy link
Contributor

@danmosemsft Yes, I believe this can be closed now that #45604 has been merged in.

And I'll gladly take a look through 😄. Feel free to ping me for AMD-specific or x64 issues (I saw the amd-perf label which I'm following).

@danmoseley
Copy link
Member

@alexcovington great, we would be excited to have more of your contributions in .NET 6.0.
cc @BruceForstall in case he has specific interesting suggestions.

@JulieLeeMSFT
Copy link
Member Author

@alexcovington thanks a lot for your contribution to JIT.
cc @sandreenko for any suggestions for alexcovington.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 26, 2021
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 help wanted [up-for-grabs] Good issue for external contributors optimization
Projects
None yet
Development

No branches or pull requests

5 participants