diff options
| author | Nirav Dave <niravd@google.com> | 2017-01-04 21:21:46 +0000 |
|---|---|---|
| committer | Nirav Dave <niravd@google.com> | 2017-01-04 21:21:46 +0000 |
| commit | 0f9d111f9730ba54b5c04ac597acd07567bb6a20 (patch) | |
| tree | 46eb43e68f795a4663c7f6e11702832431ee6391 /llvm/lib/Target | |
| parent | 6e2207a134914b20f1ecd1a5c39962bbd49f49b1 (diff) | |
| download | bcm5719-llvm-0f9d111f9730ba54b5c04ac597acd07567bb6a20.tar.gz bcm5719-llvm-0f9d111f9730ba54b5c04ac597acd07567bb6a20.zip | |
[AArch64] Fix over-eager early-exit in load-store combiner
Fix early-exit analysis for memory operation pairing when operations are
not emitted in ascending order.
Reviewers: mcrosier, t.p.northover
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D28251
llvm-svn: 291008
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp index dcb05601e5f..8a76c42b589 100644 --- a/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp @@ -1470,6 +1470,9 @@ bool AArch64LoadStoreOpt::tryToPairLdStInst(MachineBasicBlock::iterator &MBBI) { bool IsUnscaled = TII->isUnscaledLdSt(MI); int Offset = getLdStOffsetOp(MI).getImm(); int OffsetStride = IsUnscaled ? getMemScale(MI) : 1; + // Allow one more for offset. + if (Offset > 0) + Offset -= OffsetStride; if (!inBoundsForPair(IsUnscaled, Offset, OffsetStride)) return false; |

