This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mca] Add the ability to customize the instruction selection strategy in the Scheduler.
ClosedPublic

Authored by andreadb on Aug 21 2018, 10:45 AM.

Details

Summary

The constructor of Scheduler now accepts a SchedulerStrategy object, which is used internally by method Scheduler::select() to drive the instruction selection process.

The goal of this patch is to enable the definition of custom selection strategies while reusing the same algorithms implemented by class Scheduler.
The motivation is that, on some targets, the default strategy may not well approximate the selection logic in the hardware schedulers.

This patch also adds the ability to pass a ResourceManager object to the constructor of Scheduler. This gives a bit more flexibility to the design, and potentially it allows to expose processor resources to SchedulerStrategy objects.

Please let me know if okay to commit.

-Andrea

Diff Detail

Event Timeline

andreadb created this revision.Aug 21 2018, 10:45 AM
mattd accepted this revision.Aug 21 2018, 11:09 AM

LGTM, we chatted about the index calculation offline. I am okay with that instruction age calculation.

This revision is now accepted and ready to land.Aug 21 2018, 11:09 AM
This revision was automatically updated to reflect the committed changes.