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

Unified Diff: src/compiler/pipeline.cc

Issue 754843002: [turbofan] Implement jump threading after register allocation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix stupid out of bounds access in test. Created 6 years, 1 month 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/jump-threading.cc ('k') | src/compiler/schedule.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 3a0d27b0593f51ad1306350ac95b4cfb25da4093..2ab614e3c0df05ab8e4bf32cecf12af4954f5f78 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -21,6 +21,7 @@
#include "src/compiler/js-generic-lowering.h"
#include "src/compiler/js-inlining.h"
#include "src/compiler/js-typed-lowering.h"
+#include "src/compiler/jump-threading.h"
#include "src/compiler/machine-operator-reducer.h"
#include "src/compiler/pipeline-statistics.h"
#include "src/compiler/register-allocator.h"
@@ -578,6 +579,18 @@ struct ResolveControlFlowPhase {
};
+struct JumpThreadingPhase {
+ static const char* phase_name() { return "jump threading"; }
+
+ void Run(PipelineData* data, Zone* temp_zone) {
+ ZoneVector<BasicBlock::RpoNumber> result(temp_zone);
+ if (JumpThreading::ComputeForwarding(temp_zone, result, data->sequence())) {
+ JumpThreading::ApplyForwarding(result, data->sequence());
+ }
+ }
+};
+
+
struct GenerateCodePhase {
static const char* phase_name() { return "generate code"; }
@@ -902,7 +915,12 @@ void Pipeline::GenerateCode(Linkage* linkage) {
BeginPhaseKind("code generation");
- // Generate native sequence.
+ // Optimimize jumps.
+ if (FLAG_turbo_jt) {
+ Run<JumpThreadingPhase>();
+ }
+
+ // Generate final machine code.
Run<GenerateCodePhase>(linkage);
if (profiler_data != NULL) {
« no previous file with comments | « src/compiler/jump-threading.cc ('k') | src/compiler/schedule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698