Commit a5c29021 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Change map to vector in loop variable analysis.

This recovers about 50% of the regression in compilation time.

BUG=chromium:638208

Review-Url: https://codereview.chromium.org/2274053002
Cr-Commit-Position: refs/heads/master@{#38854}
parent 920f5fcd
......@@ -28,7 +28,7 @@ LoopVariableOptimizer::LoopVariableOptimizer(Graph* graph,
: graph_(graph),
common_(common),
zone_(zone),
limits_(zone),
limits_(graph->NodeCount(), zone),
induction_vars_(zone) {}
void LoopVariableOptimizer::Run() {
......@@ -40,14 +40,13 @@ void LoopVariableOptimizer::Run() {
queue.pop();
queued.Set(node, false);
DCHECK(limits_.find(node->id()) == limits_.end());
DCHECK_NULL(limits_[node->id()]);
bool all_inputs_visited = true;
int inputs_end = (node->opcode() == IrOpcode::kLoop)
? kFirstBackedge
: node->op()->ControlInputCount();
for (int i = 0; i < inputs_end; i++) {
auto input = limits_.find(NodeProperties::GetControlInput(node, i)->id());
if (input == limits_.end()) {
if (limits_[NodeProperties::GetControlInput(node, i)->id()] == nullptr) {
all_inputs_visited = false;
break;
}
......@@ -55,7 +54,7 @@ void LoopVariableOptimizer::Run() {
if (!all_inputs_visited) continue;
VisitNode(node);
DCHECK(limits_.find(node->id()) != limits_.end());
DCHECK_NOT_NULL(limits_[node->id()]);
// Queue control outputs.
for (Edge edge : node->use_edges()) {
......
......@@ -106,7 +106,7 @@ class LoopVariableOptimizer {
Graph* graph_;
CommonOperatorBuilder* common_;
Zone* zone_;
ZoneMap<int, const VariableLimits*> limits_;
ZoneVector<const VariableLimits*> limits_;
ZoneMap<int, InductionVariable*> induction_vars_;
};
......
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