summaryrefslogtreecommitdiffstats
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
commit6f6b590b996b21c90af7c35685214b5e298dc5aa (patch)
tree1f75e2ec2027facc098c19b8600e7af0965ac602
parent799a08ae480c9c6cc30d856e94d29268ade29ee0 (diff)
downloadbcm5719-llvm-6f6b590b996b21c90af7c35685214b5e298dc5aa.tar.gz
bcm5719-llvm-6f6b590b996b21c90af7c35685214b5e298dc5aa.zip
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. llvm-svn: 112622
-rw-r--r--llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 0fa1727310c..e692988fd52 100644
--- a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud