add %rip to the GR64 register class. Lets avoid allocating it to anything though! :)
authorChris Lattner <sabre@nondot.org>
Fri, 26 Jun 2009 21:25:00 +0000 (21:25 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 26 Jun 2009 21:25:00 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74328 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/X86/X86RegisterInfo.td

index b180beb9d69ed82e86c663200d2fece71f054163..1b76606178f3f138e3a575010bf10646aae008b3 100644 (file)
@@ -658,6 +658,9 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
       O << " + [.-";
       PrintPICBaseSymbol();
       O << ']';
+    } else {
+      assert(MO.getTargetFlags() == X86II::MO_NO_FLAG &&
+             "Unknown operand flag for external symbol");
     }
 
     if (needCloseParen)
index d552cb3ab8e9e48790d345f4b99909dff2c013d9..996baa055a22edc9960d143531b93668a4ba405b 100644 (file)
@@ -439,7 +439,7 @@ def GR32 : RegisterClass<"X86", [i32], 32,
 
 def GR64 : RegisterClass<"X86", [i64], 64, 
                          [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11,
-                          RBX, R14, R15, R12, R13, RBP, RSP]> {
+                          RBX, R14, R15, R12, R13, RBP, RSP, RIP]> {
   let SubRegClassList = [GR8, GR8, GR16, GR32];
   let MethodProtos = [{
     iterator allocation_order_end(const MachineFunction &MF) const;
@@ -453,9 +453,9 @@ def GR64 : RegisterClass<"X86", [i64], 64,
       if (!Subtarget.is64Bit())
         return begin();  // None of these are allocatable in 32-bit.
       if (RI->hasFP(MF)) // Does the function dedicate RBP to being a frame ptr?
-        return end()-2;  // If so, don't allocate RSP or RBP
+        return end()-3;  // If so, don't allocate RIP, RSP or RBP
       else
-        return end()-1;  // If not, just don't allocate RSP
+        return end()-2;  // If not, just don't allocate RIP or RSP
     }
   }];
 }