-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Commits on Dec 2, 2021
-
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.
Configuration menu - View commit details
-
Copy full SHA for 9544736 - Browse repository at this point
Copy the full SHA 9544736View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 621e578 - Browse repository at this point
Copy the full SHA 621e578View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee3d42d - Browse repository at this point
Copy the full SHA ee3d42dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c3a1ae - Browse repository at this point
Copy the full SHA 9c3a1aeView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 2148ada - Browse repository at this point
Copy the full SHA 2148adaView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb5d904 - Browse repository at this point
Copy the full SHA eb5d904View commit details -
Configuration menu - View commit details
-
Copy full SHA for 192c7e5 - Browse repository at this point
Copy the full SHA 192c7e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for fe7ada9 - Browse repository at this point
Copy the full SHA fe7ada9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 363a812 - Browse repository at this point
Copy the full SHA 363a812View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.