MachineScheduler: Add a target hook for deciding which RegPressure sets to
authorTom Stellard <thomas.stellard@amd.com>
Wed, 16 Dec 2015 18:31:01 +0000 (18:31 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 16 Dec 2015 18:31:01 +0000 (18:31 +0000)
commit8b1351038e9bbaf7a23508588545ad14c272fff9
treecd9a00a8ce3882387e597eb7e484842243f13721
parent536f97b8b4a129ebab2c13b419b111f107d08acc
MachineScheduler: Add a target hook for deciding which RegPressure sets to
increase

Summary:
This patch adds a function called getRegPressureSetScore() to
TargetRegisterInfo.  The MachineScheduler uses this when comparing
instruction that increase the register pressure of different sets
to determine which set is safer to increase.

This hook is useful for GPU targets where the number of registers in the
class is not the best metric for determing which presser set is safer to
increase.

Future work may include adding more parameters to this function, like
for example, the current pressure level of the set or the amount that
the pressure will be increased/decreased.

Reviewers: qcolombet, escha, arsenm, atrick, MatzeB

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14806

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