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

Lauro Ramos Venancio lauro.venancio at gmail.com
Fri Jan 12 12:52:43 PST 2007



Changes in directory llvm/lib/Target/ARM:

ARMRegisterInfo.cpp updated: 1.32 -> 1.33
---
Log message:

Don't add or sub zero to sp. 


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

 ARMRegisterInfo.cpp |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.32 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.33
--- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.32	Fri Jan 12 14:35:49 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp	Fri Jan 12 14:52:27 2007
@@ -206,9 +206,11 @@
 
   MFI->setStackSize(NumBytes);
 
-  //sub sp, sp, #NumBytes
-  splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::SUB), ARM::R13,
-			     ARM::R13, NumBytes);
+  if (NumBytes) {
+    //sub sp, sp, #NumBytes
+    splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::SUB), ARM::R13,
+                                  ARM::R13, NumBytes);
+  }
 
 
   if (HasFP) {
@@ -234,9 +236,11 @@
     BuildMI(MBB, MBBI, TII.get(ARM::LDR), ARM::R11).addReg(ARM::R13).addImm(0);
   }
 
-  //add sp, sp, #NumBytes
-  splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::ADD), ARM::R13,
-			     ARM::R13, NumBytes);
+  if (NumBytes){
+    //add sp, sp, #NumBytes
+    splitInstructionWithImmediate(MBB, MBBI, TII.get(ARM::ADD), ARM::R13,
+                                  ARM::R13, NumBytes);
+  }
 
 }
 






More information about the llvm-commits mailing list