[SystemZ] Postpone NI->RISBG conversion to convertToThreeAddress()
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 31 Jul 2013 11:36:35 +0000 (11:36 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 31 Jul 2013 11:36:35 +0000 (11:36 +0000)
commitb3f912b510f8040690864126351b7021980558bb
treeb767382a270aba304d043390e89558e023b63c6d
parent8395251c0a1f16531e7f4d11a766a4a1e3d25520
[SystemZ] Postpone NI->RISBG conversion to convertToThreeAddress()

r186399 aggressively used the RISBG instruction for immediate ANDs,
both because it can handle some values that AND IMMEDIATE can't,
and because it allows the destination register to be different from
the source.  I realized later while implementing the distinct-ops
support that it would be better to leave the choice up to
convertToThreeAddress() instead.  The AND IMMEDIATE form is shorter
and is less likely to be cracked.

This is a problem for 32-bit ANDs because we assume that all 32-bit
operations will leave the high word untouched, whereas RISBG used in
this way will either clear the high word or copy it from the source
register.  The patch uses the z196 instruction RISBLG for this instead.

This means that z10 will be restricted to NILL, NILH and NILF for
32-bit ANDs, but I think that should be OK for now.  Although we're
using z10 as the base architecture, the optimization work is going
to be focused more on z196 and zEC12.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187492 91177308-0d34-0410-b5e6-96231b3b80d8
33 files changed:
lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
lib/Target/SystemZ/SystemZInstrInfo.cpp
lib/Target/SystemZ/SystemZInstrInfo.h
lib/Target/SystemZ/SystemZInstrInfo.td
test/CodeGen/SystemZ/addr-01.ll
test/CodeGen/SystemZ/addr-02.ll
test/CodeGen/SystemZ/alloca-01.ll
test/CodeGen/SystemZ/and-02.ll
test/CodeGen/SystemZ/and-04.ll
test/CodeGen/SystemZ/atomicrmw-add-01.ll
test/CodeGen/SystemZ/atomicrmw-add-02.ll
test/CodeGen/SystemZ/atomicrmw-and-01.ll
test/CodeGen/SystemZ/atomicrmw-and-02.ll
test/CodeGen/SystemZ/atomicrmw-and-04.ll
test/CodeGen/SystemZ/atomicrmw-minmax-01.ll
test/CodeGen/SystemZ/atomicrmw-minmax-02.ll
test/CodeGen/SystemZ/atomicrmw-nand-01.ll
test/CodeGen/SystemZ/atomicrmw-nand-02.ll
test/CodeGen/SystemZ/atomicrmw-nand-04.ll
test/CodeGen/SystemZ/atomicrmw-or-01.ll
test/CodeGen/SystemZ/atomicrmw-or-02.ll
test/CodeGen/SystemZ/atomicrmw-sub-01.ll
test/CodeGen/SystemZ/atomicrmw-sub-02.ll
test/CodeGen/SystemZ/atomicrmw-xchg-01.ll
test/CodeGen/SystemZ/atomicrmw-xchg-02.ll
test/CodeGen/SystemZ/atomicrmw-xor-01.ll
test/CodeGen/SystemZ/atomicrmw-xor-02.ll
test/CodeGen/SystemZ/cmpxchg-01.ll
test/CodeGen/SystemZ/cmpxchg-02.ll
test/CodeGen/SystemZ/fp-move-02.ll
test/CodeGen/SystemZ/insert-01.ll
test/CodeGen/SystemZ/insert-02.ll
test/CodeGen/SystemZ/risbg-01.ll