[AArch64] Remove an overly conservative check when generating store pairs.
authorChad Rosier <mcrosier@codeaurora.org>
Tue, 9 Jun 2015 20:59:41 +0000 (20:59 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Tue, 9 Jun 2015 20:59:41 +0000 (20:59 +0000)
commite2e26b486d6ae336927e99898eddc01e08c37e44
treecbc3c11f108a6b1266e9f2968ab77be5b699f104
parenta96fc7ab00e84f85bf1f85c5c9264ad3a1bd280d
[AArch64] Remove an overly conservative check when generating store pairs.

Store instructions do not modify register values and therefore it's safe
to form a store pair even if the source register has been read in between
the two store instructions.

Previously, the read of w1 (see below) prevented the formation of a stp.

        str      w0, [x2]
        ldr     w8, [x2, #8]
        add      w0, w8, w1
        str     w1, [x2, #4]
        ret

We now generate the following code.

        stp      w0, w1, [x2]
        ldr     w8, [x2, #8]
        add      w0, w8, w1
        ret

All correctness tests with -Ofast on A57 with Spec200x and EEMBC pass.
Performance results for SPEC2K were within noise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239432 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
test/CodeGen/AArch64/arm64-stp.ll