mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-07 12:30:57 +00:00
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
This commit is contained in:
parent
b95df124b2
commit
d4511e947e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user