[SystemZ] Prefer LHI;ST... over LAY;MV...
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Fri, 23 Aug 2013 11:18:53 +0000 (11:18 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Fri, 23 Aug 2013 11:18:53 +0000 (11:18 +0000)
commit65ddcfa8c1c05aeecd9d4fb062bb121e376aaceb
tree284fe4e394f7d0a3a059c6c7fbddc7cf38ff0643
parenta8a7099c1849fcbb4a68642a292fd0250aa46505
[SystemZ] Prefer LHI;ST... over LAY;MV...

If we had a store of an integer to memory, and the integer and store size
were suitable for a form of MV..., we used MV... no matter what.  We could
then have sequences like:

    lay %r2, 0(%r3,%r4)
    mvi 0(%r2), 4

In these cases it seems better to force the constant into a register
and use a normal store:

    lhi %r2, 4
    stc %r2, 0(%r3, %r4)

since %r2 is more likely to be hoisted and is easier to rematerialize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189098 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
lib/Target/SystemZ/SystemZInstrFormats.td
lib/Target/SystemZ/SystemZOperands.td
test/CodeGen/SystemZ/alloca-02.ll
test/CodeGen/SystemZ/frame-13.ll
test/CodeGen/SystemZ/int-const-03.ll
test/CodeGen/SystemZ/int-const-04.ll
test/CodeGen/SystemZ/int-const-05.ll
test/CodeGen/SystemZ/int-const-06.ll