[PowerPC] Fix CR Bit spill pseudo expansion
commitd7217b281a970c12db226891eb0119072df02e60
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 29 Dec 2018 11:43:54 +0000 (29 11:43 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Sat, 29 Dec 2018 11:43:54 +0000 (29 11:43 +0000)
tree68cdea8b95e49e40332a036bcf3bb9e1109d0912
parentf667513b65f0112c5ff3212e69868666b0a87f89
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350153 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCRegisterInfo.cpp
test/CodeGen/PowerPC/NoCRFieldRedefWhenSpillingCRBIT.mir [new file with mode: 0644]