Thumb1 load/store optimizer: Improve code to materialize new base register.
authorMoritz Roth <moritz.roth@arm.com>
Thu, 21 Aug 2014 17:11:03 +0000 (17:11 +0000)
committerMoritz Roth <moritz.roth@arm.com>
Thu, 21 Aug 2014 17:11:03 +0000 (17:11 +0000)
commita6afad8b3364463f0ca8fd047e1bfb26ddb4dcc4
treeb73a64f1c56b0d257b2e4ed521ed97eca71368e7
parenteeb828f02915e0a0f9d907bc4e242da06c1e0f7b
Thumb1 load/store optimizer: Improve code to materialize new base register.

There are two add-immediate instructions in Thumb1: tADDi8 and tADDi3. Only
the latter supports using different source and destination registers, so
whenever we materialize a new base register (at a certain offset) we'd do
so by moving the base register value to the new register and then adding in
place. This patch changes the code to use a single tADDi3 if the offset is
small enough to fit in 3 bits.

Differential Revision: http://reviews.llvm.org/D5006

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216193 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMLoadStoreOptimizer.cpp
test/CodeGen/Thumb/ldm-stm-base-materialization.ll [new file with mode: 0644]
test/CodeGen/Thumb/thumb-ldm.ll
test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll