summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-08-31 18:49:31 +0000
committerJim Grosbach <grosbach@apple.com>2010-08-31 18:49:31 +0000
commitd4511e947ee1e89a4f199bfac0d401976930ccfe (patch)
treee960bf9fce98fcfacced2cc039da77050248f90f /lib
parentb95df124b26deae9221c05ea994464e4b5bc7f29 (diff)
downloadllvm-d4511e947ee1e89a4f199bfac0d401976930ccfe.tar.gz
llvm-d4511e947ee1e89a4f199bfac0d401976930ccfe.tar.bz2
llvm-d4511e947ee1e89a4f199bfac0d401976930ccfe.tar.xz
this assert should just be a condition, since this function is just asking if
the offset is legally encodable, not actually trying to do the encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMBaseRegisterInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 0fa1727310..e692988fd5 100644
--- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -1605,11 +1605,14 @@ bool ARMBaseRegisterInfo::isFrameOffsetLegal(const MachineInstr *MI,
}
Offset += getFrameIndexInstrOffset(MI, i);
- assert((Offset & (Scale-1)) == 0 && "Can't encode this offset!");
+ // Make sure the offset is encodable for instructions that scale the
+ // immediate.
+ if ((Offset & (Scale-1)) != 0)
+ return false;
+
if (isSigned && Offset < 0)
Offset = -Offset;
-
unsigned Mask = (1 << NumBits) - 1;
if ((unsigned)Offset <= Mask * Scale)
return true;