Pass the type of the store access, not the type of the store, into the
authorChris Lattner <sabre@nondot.org>
Mon, 2 Apr 2007 06:34:44 +0000 (06:34 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 2 Apr 2007 06:34:44 +0000 (06:34 +0000)
commit1ebd89eb6b4f5df8d8171ee654a73ecdf3f66580
tree62a7a54bbb59c53accbb1cc33e275cd244c64634
parent44ad85e0e89d56ca19c131aec6f840c4fc332163
Pass the type of the store access, not the type of the store, into the
target hook.  This allows us to codegen a loop as:

LBB1_1: @cond_next
        mov r2, #0
        str r2, [r0, +r3, lsl #2]
        add r3, r3, #1
        cmn r3, #1
        bne LBB1_1      @cond_next

instead of:

LBB1_1: @cond_next
        mov r2, #0
        str r2, [r0], #+4
        add r3, r3, #1
        cmn r3, #1
        bne LBB1_1      @cond_next

This looks the same, but has one fewer induction variable (and therefore,
one fewer register) live in the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35592 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp