-
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
Optimize CAST(int <- long)
on 32 bit targets
#53040
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet-issue-labeler
bot
added
the
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
label
May 20, 2021
SingleAccretion
force-pushed
the
De-Decompose-Casts
branch
7 times, most recently
from
May 22, 2021 23:17
7188bef
to
9048f58
Compare
Revert the implementation in lowering
Move the code from lowering to long decomposition.
For OptimizeCastFromDecomposedLong.
While correct, it has questionable value.
SingleAccretion
force-pushed
the
De-Decompose-Casts
branch
from
June 2, 2021 20:55
9048f58
to
bb0b7d5
Compare
It is easy to get it wrong. Let the frontend handle this.
Note to myself: the code assumes (indeed, asserts) that there are no nodes between the cast and the source. That is an incorrect assumption and must be fixed. Edit: fixed. |
Previous version of the code assumed that there could be no nodes between the cast and its operand. That is not a correct assumption to make in LIR.
SingleAccretion
force-pushed
the
De-Decompose-Casts
branch
from
June 16, 2021 11:21
f275454
to
b6ddd26
Compare
CC. @dotnet/jit-contrib, community PR |
sandreenko
approved these changes
Jun 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the diffs are quite impressive, nice catch for 32-bit platforms!
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
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.
Simple optimization in decomposition: throw away the high parts of casts from
GT_LONG
s to smaller types (right now it will only find casts toint
s because morph "decomposes"CAST(small type <- long)
toCAST(small type <- CAST(int <- long))
, but the implementation handles both because it is trivial to do so).Some pretty significant diffs for this change:
Windows x86
Linux ARM
I spot-checked the regressions and they seem to be due to slightly different register allocation (and one due to a loop now being aligned).
There is one regression on
ARM
(inCounts:get_SignalCount
) that is caused by the fact that unused indirections appear to generate more code that those used by aGT_LONG
(LIR diff, codegen dump diff).