This is an archive of the discontinued LLVM Phabricator instance.

MachineScheduler: Limit the size of the ready list.
ClosedPublic

Authored by MatzeB on Apr 20 2016, 6:21 PM.

Details

Summary

Avoid quadratic complexity in unusually large basic blocks by limiting
the size of the ready lists.

Measuring llvm test-suite for SPEC2000 shows that the ready queue size never exceed 200 on X86 and only exceeds the 256 limit 3 times on AArch64 (with benign/no changes).

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 54449.Apr 20 2016, 6:21 PM
MatzeB retitled this revision from to MachineScheduler: Limit the size of the ready list..
MatzeB updated this object.
MatzeB added a reviewer: atrick.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.
atrick edited edge metadata.Apr 20 2016, 7:58 PM

I really think you need to do this in releasePending too.

This likely affects AMDGPU in some cases, since shaders often have very large basic blocks as well. However, a test run on the external shader-db showed no notable changes, so no objections from that side.

MatzeB updated this revision to Diff 54603.Apr 21 2016, 7:39 PM
MatzeB edited edge metadata.

Thanks for the review! The new version check the limit in releasePending() as well.

This likely affects AMDGPU in some cases, since shaders often have very large basic blocks as well. However, a test run on the external shader-db showed no notable changes, so no objections from that side.

While you obviously cannot get huge ready queues in small blocks, most large basic blocks still don't lead to situations in which several hundred values are ready at the same time.

atrick accepted this revision.Apr 21 2016, 8:26 PM
atrick edited edge metadata.

LGTM

This revision is now accepted and ready to land.Apr 21 2016, 8:26 PM
This revision was automatically updated to reflect the committed changes.