Repository navigation
Optimize CAST(int <- long) on 32 bit targets - #53040
Merged
Merged
Conversation
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
SingleAccretion
marked this pull request as ready for review
June 2, 2021 23:29
It is easy to get it wrong. Let the frontend handle this.
Contributor
Author
|
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
Member
|
CC. @dotnet/jit-contrib, community PR |
sandreenko
approved these changes
Jun 24, 2021
sandreenko
left a comment
Contributor
There was a problem hiding this comment.
LGTM, the diffs are quite impressive, nice catch for 32-bit platforms!
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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_LONGs to smaller types (right now it will only find casts toints 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).