summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-03-11 18:34:58 +0000
committerEric Christopher <echristo@gmail.com>2015-03-11 18:34:58 +0000
commit4320495319466c12543985ff7e653aedf81f8f36 (patch)
tree9f4dedbe678ceeb422e0ce0e58a9ba72db47f850 /llvm/lib
parent7474dd92d3b8be5723fea9d5f13a61e6d94f4466 (diff)
downloadbcm5719-llvm-4320495319466c12543985ff7e653aedf81f8f36.tar.gz
bcm5719-llvm-4320495319466c12543985ff7e653aedf81f8f36.zip
Have getRegPressureSetLimit take a MachineFunction so that a
we can inspect the subtarget and function when computing values. llvm-svn: 231951
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/RegisterClassInfo.cpp4
-rw-r--r--llvm/lib/Target/R600/SIRegisterInfo.cpp3
-rw-r--r--llvm/lib/Target/R600/SIRegisterInfo.h3
3 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegisterClassInfo.cpp b/llvm/lib/CodeGen/RegisterClassInfo.cpp
index 4e1ede8618f..178fa18ac5a 100644
--- a/llvm/lib/CodeGen/RegisterClassInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterClassInfo.cpp
@@ -176,6 +176,6 @@ unsigned RegisterClassInfo::computePSetLimit(unsigned Idx) const {
}
compute(RC);
unsigned NReserved = RC->getNumRegs() - getNumAllocatableRegs(RC);
- return TRI->getRegPressureSetLimit(Idx)
- - TRI->getRegClassWeight(RC).RegWeight * NReserved;
+ return TRI->getRegPressureSetLimit(*MF, Idx) -
+ TRI->getRegClassWeight(RC).RegWeight * NReserved;
}
diff --git a/llvm/lib/Target/R600/SIRegisterInfo.cpp b/llvm/lib/Target/R600/SIRegisterInfo.cpp
index 257147243a8..b86ffb84c47 100644
--- a/llvm/lib/Target/R600/SIRegisterInfo.cpp
+++ b/llvm/lib/Target/R600/SIRegisterInfo.cpp
@@ -66,7 +66,8 @@ BitVector SIRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
return Reserved;
}
-unsigned SIRegisterInfo::getRegPressureSetLimit(unsigned Idx) const {
+unsigned SIRegisterInfo::getRegPressureSetLimit(const MachineFunction &MF,
+ unsigned Idx) const {
// FIXME: We should adjust the max number of waves based on LDS size.
unsigned SGPRLimit = getNumSGPRsAllowed(ST.getGeneration(),
diff --git a/llvm/lib/Target/R600/SIRegisterInfo.h b/llvm/lib/Target/R600/SIRegisterInfo.h
index 1dfe53093eb..c7d2ca7a6d2 100644
--- a/llvm/lib/Target/R600/SIRegisterInfo.h
+++ b/llvm/lib/Target/R600/SIRegisterInfo.h
@@ -28,7 +28,8 @@ struct SIRegisterInfo : public AMDGPURegisterInfo {
BitVector getReservedRegs(const MachineFunction &MF) const override;
- unsigned getRegPressureSetLimit(unsigned Idx) const override;
+ unsigned getRegPressureSetLimit(const MachineFunction &MF,
+ unsigned Idx) const override;
bool requiresRegisterScavenging(const MachineFunction &Fn) const override;
OpenPOWER on IntegriCloud