projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
799a08a
)
this assert should just be a condition, since this function is just asking if
author
Jim Grosbach
<grosbach@apple.com>
Tue, 31 Aug 2010 18:49:31 +0000
(18:49 +0000)
committer
Jim Grosbach
<grosbach@apple.com>
Tue, 31 Aug 2010 18:49:31 +0000
(18:49 +0000)
the offset is legally encodable, not actually trying to do the encoding.
llvm-svn: 112622
llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index 0fa1727310c9faf3ebbf9f67bc77b5dc584ccdde..e692988fd52f5138e7c8585b23b342c4b2fdbb0b 100644
(file)
--- 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;