Move GenericScheduler and PostGenericScheduler into a header.
authorAndrew Trick <atrick@apple.com>
Wed, 4 Jun 2014 07:06:18 +0000 (07:06 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 4 Jun 2014 07:06:18 +0000 (07:06 +0000)
commit0c834245566d39a29df01d6ea276e13830473d26
tree589ab2a58c558b299c541f8c352bf93af8f26735
parente5d8481310415d60ec64d6283aeaa4ee1ed7089b
Move GenericScheduler and PostGenericScheduler into a header.

These were not exposed previously because I didn't want out-of-tree
targets to be too dependent on their internals. They can be reused for
a very wide variety of processors with casual scheduling needs without
exposing the classes by instead using hooks defined in
MachineSchedPolicy (we can add more if needed). When targets are more
aggressively tuned or want to provide custom heuristics, they can
define their own MachineSchedStrategy. I tend to think this is better
once you start customizing heuristics because you can copy over only
what you need. I don't think that layering heuristics generally works
well.

However, Arch64 targets now want to reuse the Generic scheduling logic
but also provide extensions. I don't see much harm in exposing the
Generic scheduling classes with a major caveat: these scheduling
strategies may change in the future without validating performance on
less mainstream processors. If you want to be immune from changes,
just define your own MachineSchedStrategy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210166 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineScheduler.h
lib/CodeGen/MachineScheduler.cpp