[JSC] DFGLoopUnrollingPhase: Enforce tail and exit block unification for safe unrolling#43925
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Apr 11, 2025
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 0281b14) Details |
Constellation
approved these changes
Apr 10, 2025
Member
Constellation
left a comment
There was a problem hiding this comment.
r=me if you ensure that this does not break the existing cases in JS2.
0281b14 to
7a13b13
Compare
Collaborator
|
EWS run on current version of this PR (hash 7a13b13) Details |
…for safe unrolling https://bugs.webkit.org/show_bug.cgi?id=291393 rdar://149023954 Reviewed by Yusuke Suzuki. This patch tightens the eligibility criteria for loop unrolling by requiring that the loop tail (block that branches back to the header) and the loop exit block (block that exits the loop) must be the same. This restriction ensures the loop follows a simple and well-structured control flow pattern, making it safe for full unrolling without introducing correctness issues or complex edge handling. Specifically: 1. Identifies the tail block by looking for a unique predecessor of the header that dominates it. 2. Identifies the exit block as a loop body block with a successor outside the loop. 3. Skips unrolling if multiple tails, multiple exits, or mismatched tail and exit blocks are found. This change is a preparatory step for broader loop unrolling support in the future. * Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp: (JSC::DFG::LoopUnrollingPhase::locateTail): Canonical link: https://commits.webkit.org/293588@main
7a13b13 to
1eb0a41
Compare
Collaborator
|
Committed 293588@main (1eb0a41): https://commits.webkit.org/293588@main Reviewed commits have been landed. Closing PR #43925 and removing active labels. |
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.
1eb0a41
7a13b13
🛠 win🧪 win-tests🧪 ios-wk2🧪 api-mac🧪 ios-wk2-wpt🧪 mac-wk1🛠 wpe-cairo🛠 🧪 jsc🧪 api-ios🧪 mac-wk2🛠 🧪 jsc-arm64🧪 mac-AS-debug-wk2🧪 gtk-wk2🧪 mac-wk2-stress🧪 api-gtk🧪 vision-wk2🧪 mac-intel-wk2🛠 playstation🛠 tv🛠 mac-safer-cpp🛠 tv-sim🧪 jsc-armv7-tests🛠 watch🛠 watch-sim