[SystemZ] Add instruction-shortening pass
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 25 Sep 2013 10:11:07 +0000 (10:11 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 25 Sep 2013 10:11:07 +0000 (10:11 +0000)
commitc2b840cb7c58e59c68aaa589841c41fb272df66d
treeb9ba05d65c96d6b7e9d32d3fa75caa9c4abeb45b
parent8ba3f9c9008223136207295b48b53c8aefffa178
[SystemZ] Add instruction-shortening pass

When loading immediates into a GR32, the port prefered LHI, followed by
LLILH or LLILL, followed by IILF.  LHI and IILF are natural 32-bit
operations, but LLILH and LLILL also clear the upper 32 bits of the register.
This was represented as taking a 32-bit subreg of a 64-bit assignment.

Using subregs for something as simple as a move immediate was probably
a bad idea.  Also, I have patches to add support for the high-word facility,
and we don't want something like LLILH and LLILL to stop the high word of
the same GPR from being used.

This patch therefore uses LHI and IILF to begin with and adds a late
machine-specific pass to use LLILH and LLILL if the other half of the
register is not live.  The high-word patches extend this behavior to
IIHF, LLIHL and LLIHH.

No behavioral change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191363 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/CMakeLists.txt
lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp
lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.h
lib/Target/SystemZ/SystemZ.h
lib/Target/SystemZ/SystemZInstrInfo.td
lib/Target/SystemZ/SystemZRegisterInfo.h
lib/Target/SystemZ/SystemZShortenInst.cpp [new file with mode: 0644]
lib/Target/SystemZ/SystemZTargetMachine.cpp