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

Unified Diff: src/compiler/pipeline.cc

Issue 816053002: [turbofan] First version of loop peeling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/osr.h ('k') | src/compiler/scheduler.cc » ('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 eb9ed4c26828a6705d25242da1ad3bd09cddb9a9..73aa9627b329e5402496309e54896ae4969ea7d4 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -27,6 +27,8 @@
#include "src/compiler/js-typed-lowering.h"
#include "src/compiler/jump-threading.h"
#include "src/compiler/load-elimination.h"
+#include "src/compiler/loop-analysis.h"
+#include "src/compiler/loop-peeling.h"
#include "src/compiler/machine-operator-reducer.h"
#include "src/compiler/move-optimizer.h"
#include "src/compiler/osr.h"
@@ -504,6 +506,23 @@ struct LateControlReductionPhase : ControlReductionPhase {
};
+struct StressLoopPeelingPhase {
+ static const char* phase_name() { return "stress loop peeling"; }
+
+ void Run(PipelineData* data, Zone* temp_zone) {
+ SourcePositionTable::Scope pos(data->source_positions(),
+ SourcePosition::Unknown());
+ // Peel the first outer loop for testing.
+ // TODO(titzer): peel all loops? the N'th loop? Innermost loops?
+ LoopTree* loop_tree = LoopFinder::BuildLoopTree(data->graph(), temp_zone);
+ if (loop_tree != NULL && loop_tree->outer_loops().size() > 0) {
+ LoopPeeler::Peel(data->graph(), data->common(), loop_tree,
+ loop_tree->outer_loops()[0], temp_zone);
+ }
+ }
+};
+
+
struct GenericLoweringPhase {
static const char* phase_name() { return "generic lowering"; }
@@ -828,6 +847,11 @@ Handle<Code> Pipeline::GenerateCode() {
Run<TypedLoweringPhase>();
RunPrintAndVerify("Lowered typed");
+ if (FLAG_turbo_stress_loop_peeling) {
+ Run<StressLoopPeelingPhase>();
+ RunPrintAndVerify("Loop peeled", true);
+ }
+
if (info()->is_osr()) {
Run<OsrDeconstructionPhase>();
RunPrintAndVerify("OSR deconstruction");
« no previous file with comments | « src/compiler/osr.h ('k') | src/compiler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698