Zero is always a legal AM immediate.
authorEvan Cheng <evan.cheng@apple.com>
Tue, 13 Mar 2007 20:37:59 +0000 (20:37 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 13 Mar 2007 20:37:59 +0000 (20:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35087 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp

index 2038a3e3aefc196ac8d0673fcda69a50757fc063..f23d8aeb37eb447411e85732839e9b4de46e0caf 100644 (file)
@@ -1273,6 +1273,9 @@ ARMTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI,
 /// as the offset of the target addressing mode for load / store of the
 /// given type.
 bool ARMTargetLowering::isLegalAddressImmediate(int64_t V,const Type *Ty) const{
+  if (V == 0)
+    return true;
+
   MVT::ValueType VT = getValueType(Ty);
   if (Subtarget->isThumb()) {
     if (V < 0)