[Thumb] Make load/store optimizer less conservative.
authorMoritz Roth <moritz.roth@arm.com>
Wed, 24 Sep 2014 16:35:50 +0000 (16:35 +0000)
committerMoritz Roth <moritz.roth@arm.com>
Wed, 24 Sep 2014 16:35:50 +0000 (16:35 +0000)
commit8c4e64af8af34f433c14c8b69e8dd122887cfcb8
treeb37807bd7b86cf6381a36ed7a495ecafcc80722f
parent43c6b6be8f9a32490a146687e49b036576b0a3fa
[Thumb] Make load/store optimizer less conservative.

If it's safe to clobber the condition flags, we can do a few extra things:
it's then possible to reset the base register writeback using a SUBS, so
we can try to merge even if the base register isn't dead after the merged
instruction.

This is effectively a (heavily bug-fixed) rewrite of r208992.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218386 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMLoadStoreOptimizer.cpp
test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll
test/CodeGen/Thumb/dyn-stackalloc.ll
test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll