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,
jsgraph_(js_graph),
node_conditions_(zone, js_graph->graph()->NodeCount()),
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() {}
......
......@@ -36,7 +36,6 @@ Decision DecideCondition(Node* const cond) {
} // namespace
CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph,
CommonOperatorBuilder* common,
MachineOperatorBuilder* machine)
......@@ -44,8 +43,9 @@ CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph,
graph_(graph),
common_(common),
machine_(machine),
dead_(graph->NewNode(common->Dead())) {}
dead_(graph->NewNode(common->Dead())) {
NodeProperties::SetType(dead_, Type::None());
}
Reduction CommonOperatorReducer::Reduce(Node* node) {
switch (node->opcode()) {
......
......@@ -18,8 +18,9 @@ DeadCodeElimination::DeadCodeElimination(Editor* editor, Graph* graph,
: AdvancedReducer(editor),
graph_(graph),
common_(common),
dead_(graph->NewNode(common->Dead())) {}
dead_(graph->NewNode(common->Dead())) {
NodeProperties::SetType(dead_, Type::None());
}
Reduction DeadCodeElimination::Reduce(Node* node) {
switch (node->opcode()) {
......
......@@ -25,15 +25,17 @@ enum class GraphReducer::State : uint8_t {
void Reducer::Finalize() {}
GraphReducer::GraphReducer(Zone* zone, Graph* graph, Node* dead)
: graph_(graph),
dead_(dead),
state_(graph, 4),
reducers_(zone),
revisit_(zone),
stack_(zone) {}
stack_(zone) {
if (dead != nullptr) {
NodeProperties::SetType(dead_, Type::None());
}
}
GraphReducer::~GraphReducer() {}
......
......@@ -721,6 +721,7 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
ZoneHandleSet<Map> object_maps;
if (state->LookupMaps(object, &object_maps) && object_maps.size() == 1) {
Node* value = jsgraph()->HeapConstant(object_maps[0]);
NodeProperties::SetType(value, Type::OtherInternal());
ReplaceWithValue(node, value, effect);
return Replace(value);
}
......@@ -736,6 +737,7 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
if (!NodeProperties::GetType(replacement)->Is(node_type)) {
replacement = graph()->NewNode(common()->TypeGuard(node_type),
replacement, control);
NodeProperties::SetType(replacement, node_type);
}
ReplaceWithValue(node, replacement, effect);
return Replace(replacement);
......@@ -805,6 +807,7 @@ Reduction LoadElimination::ReduceLoadElement(Node* node) {
if (!NodeProperties::GetType(replacement)->Is(node_type)) {
replacement = graph()->NewNode(common()->TypeGuard(node_type),
replacement, control);
NodeProperties::SetType(replacement, node_type);
}
ReplaceWithValue(node, replacement, effect);
return Replace(replacement);
......
......@@ -1550,13 +1550,6 @@ bool PipelineImpl::CreateGraph() {
Run<LoopExitEliminationPhase>();
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.
......@@ -1572,6 +1565,11 @@ bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
PipelineData* data = this->data_;
if (!data->is_asm()) {
if (FLAG_turbo_load_elimination) {
Run<LoadEliminationPhase>();
RunPrintAndVerify("Load eliminated");
}
if (FLAG_turbo_escape) {
Run<EscapeAnalysisPhase>();
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