Commit 3b083983 authored by shiyu.zhang's avatar shiyu.zhang Committed by Commit bot

[turbofan] Instruction scheduler: keep ready nodes with same latency sorted in original order.

This is a complement to
https://codereview.chromium.org/2281523002.

The patch above reversed the order of nodes with same
latency, which caused bench_copy.js 4% regression and
bench_skinning.js 5% regression on Atom when enabling
'--turbo-instruction-scheduling' flag according to our
observation.

We submit this patch to sort the nodes with same latency
in original order. It aligns with instruction scheduling
logic before the patch above and fixes these regression.

BUG=

Review-Url: https://codereview.chromium.org/2284373002
Cr-Commit-Position: refs/heads/master@{#39228}
parent 30b4b82b
......@@ -17,7 +17,7 @@ void InstructionScheduler::SchedulingQueueBase::AddNode(
// the next best candidate to schedule.
auto it = nodes_.begin();
while ((it != nodes_.end()) &&
((*it)->total_latency() > node->total_latency())) {
((*it)->total_latency() >= node->total_latency())) {
++it;
}
nodes_.insert(it, node);
......
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