[llvm-mca] Add the ability to customize the instruction selection strategy in the...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 21 Aug 2018 18:20:16 +0000 (18:20 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Tue, 21 Aug 2018 18:20:16 +0000 (18:20 +0000)
commitf3374f04ad099c789717c209c27e77dc4d320689
tree26506d30f4cfd9b1f8b91c64ba655c8df722c82f
parent9848e0c9ac4e39b3ce2c3ca83b59704686064247
[llvm-mca] Add the ability to customize the instruction selection strategy in the Scheduler.

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.

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

llvm-svn: 340314
llvm/tools/llvm-mca/Scheduler.cpp
llvm/tools/llvm-mca/Scheduler.h