Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: src/compiler/pipeline.cc

Issue 2143163002: [turbofan] Loop peeling with explicit loop exits. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/loop-peeling.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index faa295f16f49bd65920904088495d5b0bb4ad603..9683a83d68dc7b5c6c6132ce98b30d934476f05f 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -942,6 +942,22 @@ struct RepresentationSelectionPhase {
}
};
+struct LoopPeelingPhase {
+ static const char* phase_name() { return "loop peeling"; }
+
+ void Run(PipelineData* data, Zone* temp_zone) {
+ GraphTrimmer trimmer(temp_zone, data->graph());
+ NodeVector roots(temp_zone);
+ data->jsgraph()->GetCachedNodes(&roots);
+ trimmer.TrimGraph(roots.begin(), roots.end());
+
+ LoopTree* loop_tree =
+ LoopFinder::BuildLoopTree(data->jsgraph()->graph(), temp_zone);
+ LoopPeeler::PeelInnerLoopsOfTree(data->graph(), data->common(), loop_tree,
+ temp_zone);
+ }
+};
+
struct LoopExitEliminationPhase {
static const char* phase_name() { return "loop exit elimination"; }
@@ -1438,9 +1454,13 @@ bool PipelineImpl::CreateGraph() {
Run<TypedLoweringPhase>();
RunPrintAndVerify("Lowered typed");
- // Eventually, loop peeling will be done here.
- Run<LoopExitEliminationPhase>();
- RunPrintAndVerify("Loop exits eliminated", true);
+ if (FLAG_turbo_loop_peeling) {
+ Run<LoopPeelingPhase>();
+ RunPrintAndVerify("Loops peeled", true);
+ } else {
+ Run<LoopExitEliminationPhase>();
+ RunPrintAndVerify("Loop exits eliminated", true);
+ }
if (FLAG_turbo_stress_loop_peeling) {
Run<StressLoopPeelingPhase>();
« no previous file with comments | « src/compiler/loop-peeling.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698