[PowerPC] Fix CR Bit spill pseudo expansion
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 29 Dec 2018 11:43:54 +0000 (11:43 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 29 Dec 2018 11:43:54 +0000 (11:43 +0000)
commit3c7ac649ecc244a342c1374ff0d7931c6da54961
tree6225e8171be53d74c68a87d98c3d3093b8a2954e
parenta6424e7c4e53c2d083aa2ceacb41a27d880f26ca
[PowerPC] Fix CR Bit spill pseudo expansion

The current CRBIT spill pseudo-op expansion creates a KILL instruction
that kills the CRBIT and defines the enclosing CR field. However, this
paints a false picture to the register allocator that all bits in the CR
field are killed so copies of other bits out of the field become dead and
removable.
This changes the expansion to preserve the KILL flag on the CRBIT as an
implicit use and to treat the CR field as an undef input.

Thanks to Hal Finkel for the review and Uli Weigand for implementation input.

Differential revision: https://reviews.llvm.org/D55996

llvm-svn: 350153
llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
llvm/test/CodeGen/PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir [new file with mode: 0644]