diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-03-15 18:41:52 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-03-15 18:41:52 +0000 |
commit | 019195229693c1829e6ed5a3f57209728fdcba8f (patch) | |
tree | c94b13efa0c791c10c7a53cb46c26cac491549c3 /lib/Target/ARM/ARMLoadStoreOptimizer.cpp | |
parent | 59f727e57e1f84519ae71b96010a702acd66d360 (diff) |
Do not form thumb2 ldrd / strd if the offset is by multiple of 4. rdar://9133587
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127683 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMLoadStoreOptimizer.cpp')
-rw-r--r-- | lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index d9dc5cdedb..23e0788a06 100644 --- a/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -1530,15 +1530,9 @@ ARMPreAllocLoadStoreOpt::CanFormLdStDWord(MachineInstr *Op0, MachineInstr *Op1, // Then make sure the immediate offset fits. int OffImm = getMemoryOpOffset(Op0); if (isT2) { - if (OffImm < 0) { - if (OffImm < -255) - // Can't fall back to t2LDRi8 / t2STRi8. - return false; - } else { - int Limit = (1 << 8) * Scale; - if (OffImm >= Limit || (OffImm & (Scale-1))) - return false; - } + int Limit = (1 << 8) * Scale; + if (OffImm >= Limit || (OffImm <= -Limit) || (OffImm & (Scale-1))) + return false; Offset = OffImm; } else { ARM_AM::AddrOpc AddSub = ARM_AM::add; |