diff options
| author | Andrew Trick <atrick@apple.com> | 2012-01-11 03:56:08 +0000 | 
|---|---|---|
| committer | Andrew Trick <atrick@apple.com> | 2012-01-11 03:56:08 +0000 | 
| commit | 642f0f6a40313fa9c16d941f7691652deb60f08e (patch) | |
| tree | a36624510e4d58fdd5eeb4717a196e4eb291a100 /llvm/lib/Target | |
| parent | 05ff7f06fbcd0de441cecc005d1f3993ebe11e38 (diff) | |
| download | bcm5719-llvm-642f0f6a40313fa9c16d941f7691652deb60f08e.tar.gz bcm5719-llvm-642f0f6a40313fa9c16d941f7691652deb60f08e.zip | |
ARM Ld/St Optimizer fix.
Allow LDRD to be formed from pairs with different LDR encodings. This was the original intention of the pass. Somewhere along the way, the LDR opcodes were refined which broke the optimization. We really don't care what the original opcodes are as long as they both map to the same LDRD and the immediate still fits.
Fixes rdar://10435045 ARMLoadStoreOptimization cannot handle mixed LDRi8/LDRi12
llvm-svn: 147922
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp index 6712fb6e9ad..af6a5b8d120 100644 --- a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp +++ b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp @@ -1639,8 +1639,9 @@ bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB,          LastOp = Op;        } -      unsigned Opcode = Op->getOpcode(); -      if (LastOpcode && Opcode != LastOpcode) +      unsigned LSMOpcode +        = getLoadStoreMultipleOpcode(Op->getOpcode(), ARM_AM::ia); +      if (LastOpcode && LSMOpcode != LastOpcode)          break;        int Offset = getMemoryOpOffset(Op); @@ -1651,7 +1652,7 @@ bool ARMPreAllocLoadStoreOpt::RescheduleOps(MachineBasicBlock *MBB,        }        LastOffset = Offset;        LastBytes = Bytes; -      LastOpcode = Opcode; +      LastOpcode = LSMOpcode;        if (++NumMove == 8) // FIXME: Tune this limit.          break;      } | 

