summaryrefslogtreecommitdiff
path: root/utils/TableGen/FastISelEmitter.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-18 04:26:06 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-06-18 04:26:06 +0000
commitabdbc84b4ed4276ed3def50f554e3ba156325717 (patch)
tree0a8118fb468d1b1082af23704e254bf94de424c6 /utils/TableGen/FastISelEmitter.cpp
parent54c47c1ce94b9e549ef768e80fd004788d13ce85 (diff)
downloadllvm-abdbc84b4ed4276ed3def50f554e3ba156325717.tar.gz
llvm-abdbc84b4ed4276ed3def50f554e3ba156325717.tar.bz2
llvm-abdbc84b4ed4276ed3def50f554e3ba156325717.tar.xz
Store CodeGenRegisters as pointers so they won't be reallocated.
Reuse the CodeGenRegBank DenseMap in a few places that would build their own or use linear search. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/FastISelEmitter.cpp')
-rw-r--r--utils/TableGen/FastISelEmitter.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp
index 6c2a76734c..ef912df3e8 100644
--- a/utils/TableGen/FastISelEmitter.cpp
+++ b/utils/TableGen/FastISelEmitter.cpp
@@ -406,15 +406,7 @@ static std::string PhyRegForNode(TreePatternNode *Op,
PhysReg += static_cast<StringInit*>(OpLeafRec->getValue( \
"Namespace")->getValue())->getValue();
PhysReg += "::";
-
- std::vector<CodeGenRegister> Regs = Target.getRegisters();
- for (unsigned i = 0; i < Regs.size(); ++i) {
- if (Regs[i].TheDef == OpLeafRec) {
- PhysReg += Regs[i].getName();
- break;
- }
- }
-
+ PhysReg += Target.getRegBank().getReg(OpLeafRec)->getName();
return PhysReg;
}