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

Reduce repeated variable add operations to a single multiply. #61663

Merged
merged 9 commits into from
Dec 3, 2021

Commits on Dec 2, 2021

  1. Reduce repeated variable add operations to a single multiply.

    `gtReduceStrength` will reduce `i + i + i + i` to `i * 4`, which
    will be optimized to `i << 2`. The reduction is not limited to
    power of twos, as `i + i + i + i + i` will reduce to `i * 5`, which
    will be optimized to `lea reg1, [reg2+4*reg2]` etc on xarch.
    anthonycanino committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    9544736 View commit details
    Browse the repository at this point in the history
  2. Produce a GT_MUL compatible with non-64 bit arch.

    A `GT_MUL` with `TYP_LONG` must go through the GT_MUL preorder
    processing on non-64 bit arch. Change forces that to happen by
    creating a new GenTree node if GT_ADD can be reduced to GT_MUL
    and then running fgMorphTree on then new node.
    anthonycanino committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    621e578 View commit details
    Browse the repository at this point in the history
  3. Run jit-format.

    anthonycanino committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    ee3d42d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9c3a1ae View commit details
    Browse the repository at this point in the history
  5. Abort optimization if result will create 64-bit MUL on 32-bit arch.

    Also cleaned up the code per suggestions regarding structure (move
    to morph.cpp) and fgGlobalOpt check.
    anthonycanino committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    2148ada View commit details
    Browse the repository at this point in the history
  6. Run jit-format.

    anthonycanino committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    eb5d904 View commit details
    Browse the repository at this point in the history
  7. Fix small typo bug.

    anthonycanino committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    192c7e5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fe7ada9 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    363a812 View commit details
    Browse the repository at this point in the history