Add an option to use a virtual register as the global base register instead of
[oota-llvm.git] / lib / Target / Mips / MipsExpandPseudo.cpp
index d3b0fae8b16467ca84f3319d422068378d24efc8..b85a3b2c27e144931eac89ca9063f428a0ff0f63 100644 (file)
@@ -67,6 +67,12 @@ bool MipsExpandPseudo::runOnMachineBasicBlock(MachineBasicBlock& MBB) {
     default: 
       ++I;
       continue;
+    case Mips::SETGP2:
+      // Convert "setgp2 $globalreg, $t9" to "addu $globalreg, $v0, $t9"
+      BuildMI(MBB, I, I->getDebugLoc(), TII->get(Mips::ADDu),
+              I->getOperand(0).getReg())
+        .addReg(Mips::V0).addReg(I->getOperand(1).getReg());
+      break;
     case Mips::BuildPairF64:
       ExpandBuildPairF64(MBB, I);
       break;