[llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp

Evan Cheng evan.cheng at apple.com
Fri Feb 2 00:59:04 PST 2007



Changes in directory llvm/lib/Target/ARM:

ARMRegisterInfo.cpp updated: 1.53 -> 1.54
---
Log message:

Ugh. Only meant to do this in thumb mode.

---
Diffs of the changes:  (+10 -5)

 ARMRegisterInfo.cpp |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.53 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.54
--- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.53	Wed Jan 31 20:18:36 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp	Fri Feb  2 02:58:48 2007
@@ -1159,12 +1159,17 @@
   }
 
   if (VARegSaveSize) {
-    // Epilogue for vararg functions: pop LR to R3 and branch off it.
-    // FIXME: Verify this is still ok when R3 is no longer being reserved.
-    BuildMI(MBB, MBBI, TII.get(ARM::tPOP)).addReg(ARM::R3);
+    if (isThumb)
+      // Epilogue for vararg functions: pop LR to R3 and branch off it.
+      // FIXME: Verify this is still ok when R3 is no longer being reserved.
+      BuildMI(MBB, MBBI, TII.get(ARM::tPOP)).addReg(ARM::R3);
+
     emitSPUpdate(MBB, MBBI, VARegSaveSize, isThumb, TII);
-    BuildMI(MBB, MBBI, TII.get(ARM::tBX_RET_vararg)).addReg(ARM::R3);
-    MBB.erase(MBBI);
+
+    if (isThumb) {
+      BuildMI(MBB, MBBI, TII.get(ARM::tBX_RET_vararg)).addReg(ARM::R3);
+      MBB.erase(MBBI);
+    }
   }
 }
 






More information about the llvm-commits mailing list