Commit 37de62c9 authored by mvstanton's avatar mvstanton Committed by Commit bot

[Turbofan] run load elimination concurrently.

BUG=v8:5428
R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2602403002
Cr-Commit-Position: refs/heads/master@{#42036}
parent 7a1b3a7b
...@@ -18,7 +18,9 @@ BranchElimination::BranchElimination(Editor* editor, JSGraph* js_graph, ...@@ -18,7 +18,9 @@ BranchElimination::BranchElimination(Editor* editor, JSGraph* js_graph,
jsgraph_(js_graph), jsgraph_(js_graph),
node_conditions_(zone, js_graph->graph()->NodeCount()), node_conditions_(zone, js_graph->graph()->NodeCount()),
zone_(zone), zone_(zone),
dead_(js_graph->graph()->NewNode(js_graph->common()->Dead())) {} dead_(js_graph->graph()->NewNode(js_graph->common()->Dead())) {
NodeProperties::SetType(dead_, Type::None());
}
BranchElimination::~BranchElimination() {} BranchElimination::~BranchElimination() {}
......
...@@ -36,7 +36,6 @@ Decision DecideCondition(Node* const cond) { ...@@ -36,7 +36,6 @@ Decision DecideCondition(Node* const cond) {
} // namespace } // namespace
CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph, CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph,
CommonOperatorBuilder* common, CommonOperatorBuilder* common,
MachineOperatorBuilder* machine) MachineOperatorBuilder* machine)
...@@ -44,8 +43,9 @@ CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph, ...@@ -44,8 +43,9 @@ CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph,
graph_(graph), graph_(graph),
common_(common), common_(common),
machine_(machine), machine_(machine),
dead_(graph->NewNode(common->Dead())) {} dead_(graph->NewNode(common->Dead())) {
NodeProperties::SetType(dead_, Type::None());
}
Reduction CommonOperatorReducer::Reduce(Node* node) { Reduction CommonOperatorReducer::Reduce(Node* node) {
switch (node->opcode()) { switch (node->opcode()) {
......
...@@ -18,8 +18,9 @@ DeadCodeElimination::DeadCodeElimination(Editor* editor, Graph* graph, ...@@ -18,8 +18,9 @@ DeadCodeElimination::DeadCodeElimination(Editor* editor, Graph* graph,
: AdvancedReducer(editor), : AdvancedReducer(editor),
graph_(graph), graph_(graph),
common_(common), common_(common),
dead_(graph->NewNode(common->Dead())) {} dead_(graph->NewNode(common->Dead())) {
NodeProperties::SetType(dead_, Type::None());
}
Reduction DeadCodeElimination::Reduce(Node* node) { Reduction DeadCodeElimination::Reduce(Node* node) {
switch (node->opcode()) { switch (node->opcode()) {
......
...@@ -25,15 +25,17 @@ enum class GraphReducer::State : uint8_t { ...@@ -25,15 +25,17 @@ enum class GraphReducer::State : uint8_t {
void Reducer::Finalize() {} void Reducer::Finalize() {}
GraphReducer::GraphReducer(Zone* zone, Graph* graph, Node* dead) GraphReducer::GraphReducer(Zone* zone, Graph* graph, Node* dead)
: graph_(graph), : graph_(graph),
dead_(dead), dead_(dead),
state_(graph, 4), state_(graph, 4),
reducers_(zone), reducers_(zone),
revisit_(zone), revisit_(zone),
stack_(zone) {} stack_(zone) {
if (dead != nullptr) {
NodeProperties::SetType(dead_, Type::None());
}
}
GraphReducer::~GraphReducer() {} GraphReducer::~GraphReducer() {}
......
...@@ -721,6 +721,7 @@ Reduction LoadElimination::ReduceLoadField(Node* node) { ...@@ -721,6 +721,7 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
ZoneHandleSet<Map> object_maps; ZoneHandleSet<Map> object_maps;
if (state->LookupMaps(object, &object_maps) && object_maps.size() == 1) { if (state->LookupMaps(object, &object_maps) && object_maps.size() == 1) {
Node* value = jsgraph()->HeapConstant(object_maps[0]); Node* value = jsgraph()->HeapConstant(object_maps[0]);
NodeProperties::SetType(value, Type::OtherInternal());
ReplaceWithValue(node, value, effect); ReplaceWithValue(node, value, effect);
return Replace(value); return Replace(value);
} }
...@@ -736,6 +737,7 @@ Reduction LoadElimination::ReduceLoadField(Node* node) { ...@@ -736,6 +737,7 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
if (!NodeProperties::GetType(replacement)->Is(node_type)) { if (!NodeProperties::GetType(replacement)->Is(node_type)) {
replacement = graph()->NewNode(common()->TypeGuard(node_type), replacement = graph()->NewNode(common()->TypeGuard(node_type),
replacement, control); replacement, control);
NodeProperties::SetType(replacement, node_type);
} }
ReplaceWithValue(node, replacement, effect); ReplaceWithValue(node, replacement, effect);
return Replace(replacement); return Replace(replacement);
...@@ -805,6 +807,7 @@ Reduction LoadElimination::ReduceLoadElement(Node* node) { ...@@ -805,6 +807,7 @@ Reduction LoadElimination::ReduceLoadElement(Node* node) {
if (!NodeProperties::GetType(replacement)->Is(node_type)) { if (!NodeProperties::GetType(replacement)->Is(node_type)) {
replacement = graph()->NewNode(common()->TypeGuard(node_type), replacement = graph()->NewNode(common()->TypeGuard(node_type),
replacement, control); replacement, control);
NodeProperties::SetType(replacement, node_type);
} }
ReplaceWithValue(node, replacement, effect); ReplaceWithValue(node, replacement, effect);
return Replace(replacement); return Replace(replacement);
......
...@@ -1550,13 +1550,6 @@ bool PipelineImpl::CreateGraph() { ...@@ -1550,13 +1550,6 @@ bool PipelineImpl::CreateGraph() {
Run<LoopExitEliminationPhase>(); Run<LoopExitEliminationPhase>();
RunPrintAndVerify("Loop exits eliminated", true); RunPrintAndVerify("Loop exits eliminated", true);
} }
if (!info()->shared_info()->asm_function()) {
if (FLAG_turbo_load_elimination) {
Run<LoadEliminationPhase>();
RunPrintAndVerify("Load eliminated");
}
}
} }
// Do some hacky things to prepare for the optimization phase. // Do some hacky things to prepare for the optimization phase.
...@@ -1572,6 +1565,11 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) { ...@@ -1572,6 +1565,11 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
PipelineData* data = this->data_; PipelineData* data = this->data_;
if (!data->is_asm()) { if (!data->is_asm()) {
if (FLAG_turbo_load_elimination) {
Run<LoadEliminationPhase>();
RunPrintAndVerify("Load eliminated");
}
if (FLAG_turbo_escape) { if (FLAG_turbo_escape) {
Run<EscapeAnalysisPhase>(); Run<EscapeAnalysisPhase>();
if (data->compilation_failed()) { if (data->compilation_failed()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment