summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterClassInfo.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-10-15 21:57:41 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-10-15 21:57:41 +0000
commitc30a9af2d78765e1f7c479d7acd1fd1e4b183286 (patch)
treeee31057ef6c62608e562a43b48a2a78530aee9a3 /llvm/lib/CodeGen/RegisterClassInfo.cpp
parent57e310613c8cda5ab050bb132efe848cd5562a5f (diff)
downloadbcm5719-llvm-c30a9af2d78765e1f7c479d7acd1fd1e4b183286.tar.gz
bcm5719-llvm-c30a9af2d78765e1f7c479d7acd1fd1e4b183286.zip
Switch most getReservedRegs() clients to the MRI equivalent.
Using the cached bit vector in MRI avoids comstantly allocating and recomputing the reserved register bit vector. llvm-svn: 165983
Diffstat (limited to 'llvm/lib/CodeGen/RegisterClassInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterClassInfo.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegisterClassInfo.cpp b/llvm/lib/CodeGen/RegisterClassInfo.cpp
index 652bc3015a3..805d2356730 100644
--- a/llvm/lib/CodeGen/RegisterClassInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterClassInfo.cpp
@@ -15,8 +15,9 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "regalloc"
-#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/RegisterClassInfo.h"
+#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -57,10 +58,11 @@ void RegisterClassInfo::runOnMachineFunction(const MachineFunction &mf) {
CalleeSaved = CSR;
// Different reserved registers?
- BitVector RR = TRI->getReservedRegs(*MF);
- if (RR != Reserved)
+ const BitVector &RR = MF->getRegInfo().getReservedRegs();
+ if (Reserved.size() != RR.size() || RR != Reserved) {
Update = true;
- Reserved = RR;
+ Reserved = RR;
+ }
// Invalidate cached information from previous function.
if (Update)
OpenPOWER on IntegriCloud