summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2015-12-16 18:31:01 +0000
committerTom Stellard <thomas.stellard@amd.com>2015-12-16 18:31:01 +0000
commit5ce530608f4acfbb76e47757c07b6d349aacb8c0 (patch)
tree5cd8f735bbfded93c176dc442938c528581b56f5 /llvm/include
parentd6f5f24a298f70485c24ab31496b44cf6fd501ef (diff)
downloadbcm5719-llvm-5ce530608f4acfbb76e47757c07b6d349aacb8c0.tar.gz
bcm5719-llvm-5ce530608f4acfbb76e47757c07b6d349aacb8c0.zip
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 llvm-svn: 255795
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Target/TargetRegisterInfo.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/TargetRegisterInfo.h b/llvm/include/llvm/Target/TargetRegisterInfo.h
index ffd510440b0..fccaad4705d 100644
--- a/llvm/include/llvm/Target/TargetRegisterInfo.h
+++ b/llvm/include/llvm/Target/TargetRegisterInfo.h
@@ -668,6 +668,15 @@ public:
return 0;
}
+ /// Return a heuristic for the machine scheduler to compare the profitability
+ /// of increasing one register pressure set versus another. The scheduler
+ /// will prefer increasing the register pressure of the set which returns
+ /// the largest value for this function.
+ virtual unsigned getRegPressureSetScore(const MachineFunction &MF,
+ unsigned PSetID) const {
+ return PSetID;
+ }
+
/// Get the weight in units of pressure for this register class.
virtual const RegClassWeight &getRegClassWeight(
const TargetRegisterClass *RC) const = 0;
OpenPOWER on IntegriCloud