Repository navigation
Improve value numbering for casts - #59841
Merged
Merged
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsNow that we no longer fold overflowing conversions with implementation-defined behavior, it is possible to unify how the cast helpers are value numbered and how regular casts are numbered. There are also changes that enable global constant propagation into calls, this was necessary to fix some of the regressions that showed up. The remaining regressions are due to #57033 (we propagate "just above" the helper and see it as a side effect). Diffs: pending.
|
SingleAccretion
force-pushed
the
Refactor-Cast-VNs
branch
3 times, most recently
from
October 1, 2021 15:31
b2d50ef to
fc2cc3d
Compare
Remove duplication between VNPairForCast and VNForCast, route the former through the latter. Also change the debug output for casts. No diffs for this commit.
VN cast helpers just like casts. This allows them to be folded. In the past, this was dangerous because some of the pessimization protected us from undefined behavior in cases of out-of-bounds conversions, but now we do not fold such cases anymore.
This solves some of the regressions seen due to now-missing CSEs of these helper calls evaluated as constants by VN.
This fixes the test failures revealed by the more aggressive constant propagation. This is very similar to a bug that was recently fixed where checked casts were treated as non-checked and could be observed without the assertion propagation changes as well, with the redundant branches optimization.
SingleAccretion
force-pushed
the
Refactor-Cast-VNs
branch
from
October 1, 2021 20:16
239e961 to
3bcf1a9
Compare
SingleAccretion
marked this pull request as ready for review
October 1, 2021 22:09
Contributor
Author
|
@dotnet/jit-contrib |
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.
Now that we no longer fold overflowing conversions with implementation-defined behavior, it is possible to unify how the cast helpers are value numbered and how regular casts are numbered.
There are also changes that enable global constant propagation into calls, this was necessary to fix some of the regressions that showed up. The remaining regressions are due to #57033 (we propagate "just above" the helper and see it as a side effect).
Diffs:
win-x64,win-x86,linux-arm