From 2a6fd61dfcc3872e989651efc06a5b9e961797ff Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 30 Sep 2005 01:33:48 +0000 Subject: [PATCH] allow regs to be in multiple reg classes llvm-svn: 23540 --- llvm/utils/TableGen/RegisterInfoEmitter.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/llvm/utils/TableGen/RegisterInfoEmitter.cpp b/llvm/utils/TableGen/RegisterInfoEmitter.cpp index caae2f0b4cfe..10ff3f3f8e08 100644 --- a/llvm/utils/TableGen/RegisterInfoEmitter.cpp +++ b/llvm/utils/TableGen/RegisterInfoEmitter.cpp @@ -101,8 +101,6 @@ void RegisterInfoEmitter::run(std::ostream &OS) { const std::vector &RegisterClasses = Target.getRegisterClasses(); - std::set RegistersFound; - // Loop over all of the register classes... emitting each one. OS << "namespace { // Register classes...\n"; @@ -121,10 +119,6 @@ void RegisterInfoEmitter::run(std::ostream &OS) { << "[] = {\n "; for (unsigned i = 0, e = RC.Elements.size(); i != e; ++i) { Record *Reg = RC.Elements[i]; - if (RegistersFound.count(Reg)) - throw "Register '" + Reg->getName() + - "' included in multiple register classes!"; - RegistersFound.insert(Reg); OS << getQualifiedName(Reg) << ", "; // Keep track of which regclasses this register is in. @@ -232,18 +226,8 @@ void RegisterInfoEmitter::run(std::ostream &OS) { unsigned SpillAlign = Reg.DeclaredSpillAlignment; for (; I != E; ++I) { // For each reg class this belongs to. const CodeGenRegisterClass *RC = I->second; - if (SpillSize == 0) - SpillSize = RC->SpillSize; - else if (SpillSize != RC->SpillSize) - throw "Spill size for regclass '" + RC->getName() + - "' doesn't match spill sized already inferred for register '" + - Reg.getName() + "'!"; - if (SpillAlign == 0) - SpillAlign = RC->SpillAlignment; - else if (SpillAlign != RC->SpillAlignment) - throw "Spill alignment for regclass '" + RC->getName() + - "' doesn't match spill sized already inferred for register '" + - Reg.getName() + "'!"; + SpillSize = std::max(SpillSize, RC->SpillSize); + SpillAlign = std::max(SpillAlign, RC->SpillAlignment); } OS << SpillSize << ", " << SpillAlign << " },\n";