MachineScheduler: Refactor setPolicy() to limit computing remaining latency
authorTom Stellard <tstellar@redhat.com>
Tue, 21 Aug 2018 21:48:43 +0000 (21:48 +0000)
committerTom Stellard <tstellar@redhat.com>
Tue, 21 Aug 2018 21:48:43 +0000 (21:48 +0000)
commitecd6aa5be2e80a9b7f6e40be0e1b0db90c3c2b31
tree09a2ab2c2abc56c9ba42f598eec3bf7fa7dd3d2f
parent6a2a5c99c712dff57a6d5acd8b79b85ecbd1e7e1
MachineScheduler: Refactor setPolicy() to limit computing remaining latency

Summary:
Computing the remaining latency can be very expensive especially
on graphs of N nodes where the number of edges approaches N^2.

This reduces the compile time of a pathological case with the
AMDGPU backend from ~7.5 seconds to ~3 seconds.  This test case has
a basic block with 2655 stores, each with somewhere between 500
and 1500 successors and predecessors.

Reviewers: atrick, MatzeB, airlied, mareko

Reviewed By: mareko

Subscribers: tpr, javed.absar, llvm-commits

Differential Revision: https://reviews.llvm.org/D50486

llvm-svn: 340346
llvm/include/llvm/CodeGen/MachineScheduler.h
llvm/lib/CodeGen/MachineScheduler.cpp