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

Unified Diff: src/compiler/pipeline.cc

Issue 2428443002: [wasm] Trim graph before scheduling. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | test/cctest/wasm/test-run-wasm.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 786e83d6e7aeeaa59a9683349abb4598a06fa5ad..015dcc4a2d5837d7b3802308fd8cb5afd2bff2fa 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -389,7 +389,7 @@ class PipelineImpl final {
// Perform the actual code generation and return handle to a code object.
Handle<Code> GenerateCode(Linkage* linkage);
- bool ScheduleAndSelectInstructions(Linkage* linkage);
+ bool ScheduleAndSelectInstructions(Linkage* linkage, bool trim_graph);
void RunPrintAndVerify(const char* phase, bool untyped = false);
Handle<Code> ScheduleAndGenerateCode(CallDescriptor* call_descriptor);
void AllocateRegisters(const RegisterConfiguration* config,
@@ -692,7 +692,7 @@ PipelineWasmCompilationJob::ExecuteJobImpl() {
pipeline_.RunPrintAndVerify("Machine", true);
- if (!pipeline_.ScheduleAndSelectInstructions(&linkage_)) return FAILED;
+ if (!pipeline_.ScheduleAndSelectInstructions(&linkage_, true)) return FAILED;
return SUCCEEDED;
}
@@ -1206,7 +1206,9 @@ struct LateGraphTrimmingPhase {
void Run(PipelineData* data, Zone* temp_zone) {
GraphTrimmer trimmer(temp_zone, data->graph());
NodeVector roots(temp_zone);
- data->jsgraph()->GetCachedNodes(&roots);
+ if (data->jsgraph()) {
+ data->jsgraph()->GetCachedNodes(&roots);
+ }
trimmer.TrimGraph(roots.begin(), roots.end());
}
};
@@ -1648,13 +1650,13 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
RunPrintAndVerify("Late optimized", true);
- Run<LateGraphTrimmingPhase>();
- // TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
- RunPrintAndVerify("Late trimmed", true);
+ // Run<LateGraphTrimmingPhase>();
Benedikt Meurer 2016/10/17 07:18:46 Nit: Remove this dead code then.
ahaas 2016/10/17 07:23:57 Done
Benedikt Meurer 2016/10/17 08:38:14 Thx!
+ // // TODO(jarin, rossberg): Remove UNTYPED once machine typing works.
+ // RunPrintAndVerify("Late trimmed", true);
data->source_positions()->RemoveDecorator();
- return ScheduleAndSelectInstructions(linkage);
+ return ScheduleAndSelectInstructions(linkage, true);
}
Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate,
@@ -1767,12 +1769,17 @@ bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
return !data.compilation_failed();
}
-bool PipelineImpl::ScheduleAndSelectInstructions(Linkage* linkage) {
+bool PipelineImpl::ScheduleAndSelectInstructions(Linkage* linkage,
+ bool trim_graph) {
CallDescriptor* call_descriptor = linkage->GetIncomingDescriptor();
PipelineData* data = this->data_;
DCHECK_NOT_NULL(data->graph());
+ if (trim_graph) {
+ Run<LateGraphTrimmingPhase>();
+ RunPrintAndVerify("Late trimmed", true);
+ }
if (data->schedule() == nullptr) Run<ComputeSchedulePhase>();
TraceSchedule(data->info(), data->schedule());
@@ -1895,7 +1902,7 @@ Handle<Code> PipelineImpl::ScheduleAndGenerateCode(
Linkage linkage(call_descriptor);
// Schedule the graph, perform instruction selection and register allocation.
- if (!ScheduleAndSelectInstructions(&linkage)) return Handle<Code>();
+ if (!ScheduleAndSelectInstructions(&linkage, false)) return Handle<Code>();
// Generate the final machine code.
return GenerateCode(&linkage);
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698