This is an archive of the discontinued LLVM Phabricator instance.

MachineScheduler: Refactor setPolicy() to limit computing remaining latency
ClosedPublic

Authored by tstellar on Aug 8 2018, 6:14 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellar created this revision.Aug 8 2018, 6:14 PM
mareko accepted this revision.Aug 10 2018, 9:30 AM
This revision is now accepted and ready to land.Aug 10 2018, 9:30 AM

@atrick does this look OK to you?

Looks fine to me.

lib/CodeGen/MachineScheduler.cpp
2429 ↗(On Diff #159841)

I suggest adding a brief comment here. I think this is just a quick check to bypass computeRemLatency, and ultimately we're trying to determine whether the current cycle plus remaining latency is greater than the critical path in the scheduling region.

This revision was automatically updated to reflect the committed changes.