[ARM] Fix insert point for store rescheduling.
authorEli Friedman <efriedma@codeaurora.org>
Thu, 2 Mar 2017 21:39:39 +0000 (21:39 +0000)
committerEli Friedman <efriedma@codeaurora.org>
Thu, 2 Mar 2017 21:39:39 +0000 (21:39 +0000)
commitbb821276d0cb964f3ae60fd0f0814fd5271d063b
treea8159e93550964fbbe6146a5f5b1ea7607ac1afb
parent0a8ada5ef14ede1372e87834078da231a56f368a
[ARM] Fix insert point for store rescheduling.

In ARMPreAllocLoadStoreOpt::RescheduleOps, LastOp should be the last
operation which we want to merge. If we break out of the loop because
an operation has the wrong offset, we shouldn't use that operation
as LastOp.

This patch fixes some cases where we would move stores to the wrong
insert point.

Re-commit with a fix to increment NumMove in the right place.

Differential Revision: https://reviews.llvm.org/D30124

llvm-svn: 296815
llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
llvm/test/CodeGen/ARM/ldm-stm-i256.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/prera-ldst-insertpt.mir