forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] Loop Unrolling should not change Branch to Jump
https://bugs.webkit.org/show_bug.cgi?id=285206 rdar://142111593 Reviewed by Justin Michaud. Until later phase in FTL, we should not change Branch to Jump. Otherwise, one block's successors get reduced into one block, which confuses liveness of locals in DFG CPS graph. Instead, we preserve the graph at this phase by using Branch(True, next, header). Later FTL phase will convert this to Jump with appropriate liveness preservation but we do not need to do this analysis here. We can just use this always-true branch and keep graph. * JSTests/stress/loop-unrolling-liveness-0.js: Added. (f1): * JSTests/stress/loop-unrolling-liveness-1.js: Added. (f): * Source/JavaScriptCore/dfg/DFGLoopUnrollingPhase.cpp: (JSC::DFG::LoopUnrollingPhase::run): (JSC::DFG::LoopUnrollingPhase::populateCandidateLoops): (JSC::DFG::LoopUnrollingPhase::unrollLoop): (JSC::DFG::LoopUnrollingPhase::selectDeepestNestedLoop): Deleted. Canonical link: https://commits.webkit.org/289279@main
- Loading branch information
1 parent
384d445
commit cd234bf
Showing
4 changed files
with
79 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ runDefault("--useConcurrentJIT=0", "--thresholdForJITAfterWarmUp=10", "--thresholdForOptimizeAfterWarmUp=100", "--thresholdForFTLOptimizeAfterWarmUp=1000") | ||
function f1(a2, a3, a4) { | ||
let v5 = a2 && 99; | ||
let v6 = 0; | ||
let v8 = v5++; | ||
do { | ||
v8 &&= v5; | ||
v6++; | ||
} while (v6 < 4); | ||
return v6; | ||
} | ||
for (let v10 = 0; v10 < 100; v10++) { | ||
f1(); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function f(y) { | ||
let x = 0; | ||
for (let i = 0; i < 2; i++) { | ||
if (y) { | ||
x++; | ||
} | ||
} | ||
} | ||
for (let j = 0; j < 9; j++) { | ||
for (let k = 0; k < 999; k++) { | ||
f(k); | ||
} | ||
} | ||
(function(){})(); |
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
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