fix calls
authorAndrew Lenharth <andrewl@lenharth.org>
Thu, 14 Apr 2005 17:34:20 +0000 (17:34 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Thu, 14 Apr 2005 17:34:20 +0000 (17:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21303 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaISelPattern.cpp
lib/Target/Alpha/AlphaInstrInfo.td

index 18cc35a35691a21c3259fbc5d06bd140db42d93f..d8459815fdf1572484456f709c96914244f5a7ff 100644 (file)
@@ -1418,6 +1418,7 @@ unsigned ISel::SelectExpr(SDOperand N) {
           BuildMI(BB, Alpha::CALL, 1).addGlobalAddress(GASD->getGlobal());
         } else {
           //use PC relative branch call
+          AlphaLowering.restoreGP(BB);
           BuildMI(BB, Alpha::BSR, 1, Alpha::R26).addGlobalAddress(GASD->getGlobal(),true);
         }
       } 
index 72f21f0bf9b06b41b8a1ef4ad0588f8e0540405d..e341e858cb7f07027bba3a6b05d314947d43dca0 100644 (file)
@@ -330,7 +330,7 @@ let isCall = 1,
             R20, R21, R22, R23, R24, R25, R27, R28, R29,
             F0, F1,
             F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
-            F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30] in {
+            F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30], Uses = [R29] in {
     def JSR : MForm< 0x1A, (ops GPRC:$RD, GPRC:$RS, s14imm:$DISP), "jsr $RD,($RS),$DISP">; //Jump to subroutine
     def BSR : BForm<0x34, (ops GPRC:$RD, s21imm:$DISP), "bsr $RD,$DISP">; //Branch to subroutine
 }