diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-06 00:08:27 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-06 00:08:27 +0000 |
commit | d9c1fa5205cc31474f9f9a6d715af32098a1a719 (patch) | |
tree | 0c0fa88453f6f6a245a0738a41e51164dae98fa6 /utils | |
parent | 8f8aa815b46143e2e84a62dadf6f57daf25a4e24 (diff) | |
download | external_llvm-d9c1fa5205cc31474f9f9a6d715af32098a1a719.zip external_llvm-d9c1fa5205cc31474f9f9a6d715af32098a1a719.tar.gz external_llvm-d9c1fa5205cc31474f9f9a6d715af32098a1a719.tar.bz2 |
Remove the TRI::getSubRegisterRegClass() hook.
This restores my karma after I added TRI::getSubClassWithSubReg().
Register constraints are applied 'backwards'. Starting from the
register class required by an instruction operand, the correct question
is: 'How can I constrain the super-register register class so all its
sub-registers satisfy the instruction constraint?' The
getMatchingSuperRegClass() hook answers that.
We never need to go 'forwards': Starting from a super-register register
class, what register class are the sub-registers in? The
getSubRegisterRegClass() hook did that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/RegisterInfoEmitter.cpp | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/utils/TableGen/RegisterInfoEmitter.cpp b/utils/TableGen/RegisterInfoEmitter.cpp index a66a78c..b0f4ffc 100644 --- a/utils/TableGen/RegisterInfoEmitter.cpp +++ b/utils/TableGen/RegisterInfoEmitter.cpp @@ -543,40 +543,17 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target, unsigned NumSubRegIndices = RegBank.getSubRegIndices().size(); if (NumSubRegIndices) { - // Emit the sub-register classes for each RegisterClass + // Compute the super-register classes for each RegisterClass for (unsigned rc = 0, e = RegisterClasses.size(); rc != e; ++rc) { const CodeGenRegisterClass &RC = *RegisterClasses[rc]; - std::vector<Record*> SRC(NumSubRegIndices); for (DenseMap<Record*,Record*>::const_iterator i = RC.SubRegClasses.begin(), e = RC.SubRegClasses.end(); i != e; ++i) { - // Build SRC array. - unsigned idx = RegBank.getSubRegIndexNo(i->first); - SRC.at(idx-1) = i->second; - // Find the register class number of i->second for SuperRegClassMap. const CodeGenRegisterClass *RC2 = RegBank.getRegClass(i->second); assert(RC2 && "Invalid register class in SubRegClasses"); SuperRegClassMap[RC2->EnumValue].insert(rc); } - - // Give the register class a legal C name if it's anonymous. - std::string Name = RC.getName(); - - OS << " // " << Name - << " Sub-register Classes...\n" - << " static const TargetRegisterClass* const " - << Name << "SubRegClasses[] = {\n "; - - for (unsigned idx = 0; idx != NumSubRegIndices; ++idx) { - if (idx) - OS << ", "; - if (SRC[idx]) - OS << "&" << getQualifiedName(SRC[idx]) << "RegClass"; - else - OS << "0"; - } - OS << "\n };\n\n"; } // Emit the super-register classes for each RegisterClass @@ -651,9 +628,7 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target, OS << "NullRegClasses, "; else OS << RC.getName() + "Superclasses, "; - OS << (NumSubRegIndices ? RC.getName() + "Sub" : std::string("Null")) - << "RegClasses, " - << (NumSubRegIndices ? RC.getName() + "Super" : std::string("Null")) + OS << (NumSubRegIndices ? RC.getName() + "Super" : std::string("Null")) << "RegClasses" << ") {}\n"; if (!RC.AltOrderSelect.empty()) { |