Repository navigation
[JSC] IntegerRangeOptimization should clamp offsets when merging two Equal relationships - #79731
Open
sosukesuzuki wants to merge 1 commit into
Conversation
…Equal relationships https://bugs.webkit.org/show_bug.cgi?id=330273 Reviewed by NOBODY (OOPS!). This is a follow-up to 325526@main. When merging `@a == @b + C` and `@a == @b + D`, mergeImpl gave up if max(C, D) < -2 or min(C, D) > 2. But `@a < @b - 2` can be weakened to `@a < @b - 1`, and `@a > @b + 2` to `@a > @b + 1`. This happens in `for (i = array.length - 3; i >= 0; --i)`. `@i == @Length - 3` is merged with `@i == @Length - 4`. We lost the fact that @i is less than @Length, and its CheckInBounds was left. Baseline Patched array-length-loop-backward-from-offset 199.5842+-15.6602 ^ 169.6328+-14.0111 ^ definitely 1.1766x faster Tests: JSTests/microbenchmarks/array-length-loop-backward-from-offset.js JSTests/stress/integer-range-optimization-merge-equal-relationships-with-large-offsets.js * JSTests/microbenchmarks/array-length-loop-backward-from-offset.js: Added. (backward): * JSTests/stress/integer-range-optimization-merge-equal-relationships-with-large-offsets.js: Added. (shouldBe): (mergedBelow): (mergedJustBelow): (mergedAbove): (mergedAroundZero): (mergedLength): (mergedHugeOffsets): (mergedMinOffset): (backwardFrom3): (backwardFrom5Step2): (backwardWindow): (backwardShrinking): (backwardString): (forwardFrom3): * Source/JavaScriptCore/dfg/DFGIntegerRangeOptimizationPhase.cpp:
Collaborator
|
EWS run on current version of this PR (hash c9ad87f) Details |
This was referenced Nov 12, 2026
Constellation
approved these changes
Nov 26, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
c9ad87f
c9ad87f