HomePhabricator

[llvm-mca] Allow the definition of custom strategies for selecting processor…

Authored by andreadb on Aug 23 2018, 8:04 AM.

Description

[llvm-mca] Allow the definition of custom strategies for selecting processor resource units.

With this patch, users can now customize the pipeline selection strategy for
scheduler resources. The resource selection strategy can be defined at processor
resource granularity. This enables the definition of different strategies for
different hardware schedulers.

To override the strategy associated with a processor resource, users can call
method ResourceManager::setCustomStrategy(), and pass a 'ResourceStrategy'
object in input.

Class ResourceStrategy is an abstract class which declares virtual method
ResourceStrategy::select(). Method select() is meant to implement the actual
strategy; it is responsible for picking the next best resource from a set of
available pipeline resources. Custom strategy must simply override that method.

By default, processor resources are associated with instances of
'DefaultResourceStrategy'. A 'DefaultResourceStrategy' internally implements a
simple round-robin selector. For more details, please refer to the code comments
in Scheduler.h.

llvm-svn: 340536

Details

Committed
andreadbAug 23 2018, 8:04 AM
Parents
rG9fa662b29637: [analyzer] added cache for SMT queries in the SMTConstraintManager
Branches
Unknown
Tags
Unknown