summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/RegisterClassInfo.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-12-22 00:04:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-12-22 00:04:03 +0000
commitf8af5cf600354830d4ccf59732403f0f073eccb9 (patch)
tree2ba0398b4c42ad4f55561327538044fd2c925a8b /include/llvm/CodeGen/RegisterClassInfo.h
parent59d6cff90eecf31cb3dd860c4e786674cfdd42eb (diff)
Notes
Diffstat (limited to 'include/llvm/CodeGen/RegisterClassInfo.h')
-rw-r--r--include/llvm/CodeGen/RegisterClassInfo.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/RegisterClassInfo.h b/include/llvm/CodeGen/RegisterClassInfo.h
index 3ad22e65c8c7d..9ec12bdea0ad3 100644
--- a/include/llvm/CodeGen/RegisterClassInfo.h
+++ b/include/llvm/CodeGen/RegisterClassInfo.h
@@ -62,6 +62,8 @@ class RegisterClassInfo {
// Reserved registers in the current MF.
BitVector Reserved;
+ OwningArrayPtr<unsigned> PSetLimits;
+
// Compute all information about RC.
void compute(const TargetRegisterClass *RC) const;
@@ -126,8 +128,19 @@ public:
unsigned getLastCostChange(const TargetRegisterClass *RC) {
return get(RC).LastCostChange;
}
+
+ /// Get the register unit limit for the given pressure set index.
+ ///
+ /// RegisterClassInfo adjusts this limit for reserved registers.
+ unsigned getRegPressureSetLimit(unsigned Idx) const {
+ if (!PSetLimits[Idx])
+ PSetLimits[Idx] = computePSetLimit(Idx);
+ return PSetLimits[Idx];
+ }
+
+protected:
+ unsigned computePSetLimit(unsigned Idx) const;
};
} // end namespace llvm
#endif
-