Skip to content

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

Closed

Description

@JulieLeeMSFT

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

Activity

  1. added this to the Future milestone on Nov 7, 2020
  2. added
    help wanted[up-for-grabs] Good issue for external contributors
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Nov 7, 2020
  3. EgorBo commented on Nov 7, 2020

    @EgorBo
    Member

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

  4. alexcovington commented on Nov 11, 2020

    @alexcovington
    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?

  5. modified the milestones: Future, 6.0.0 on Dec 29, 2020
  6. danmoseley commented on Jan 27, 2021

    @danmoseley
    Contributor

    @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+

  7. alexcovington commented on Jan 27, 2021

    @alexcovington
    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).

  8. danmoseley commented on Jan 27, 2021

    @danmoseley
    Contributor

    @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.

  9. JulieLeeMSFT commented on Jan 27, 2021

    @JulieLeeMSFT
    MemberAuthor

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

  10. ghost locked as resolved and limited conversation to collaborators on Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributorsoptimization

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions