summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-03-15 18:41:52 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-03-15 18:41:52 +0000
commit42401d6af209ec08e07aee3dd5270e83ff09670c (patch)
tree2d2cf923b23749c499ee5fc756ad0757d398d97e /llvm/lib
parentb03a4c23c202f37402eadc25aa19e3f9756c50c4 (diff)
downloadbcm5719-llvm-42401d6af209ec08e07aee3dd5270e83ff09670c.tar.gz
bcm5719-llvm-42401d6af209ec08e07aee3dd5270e83ff09670c.zip
Do not form thumb2 ldrd / strd if the offset is by multiple of 4. rdar://9133587
llvm-svn: 127683
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
index d9dc5cdedb3..23e0788a06e 100644
--- a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud