ExpandPostRAPseudos should transfer implicit uses, not only implicit defs
authorMichael Kuperstein <mkuper@google.com>
Fri, 15 Jul 2016 22:31:14 +0000 (22:31 +0000)
committerMichael Kuperstein <mkuper@google.com>
Fri, 15 Jul 2016 22:31:14 +0000 (22:31 +0000)
commitbe2e3f5ce55e5563d8e21fcd707bd563ddda77ee
treeec24883063c9e38d43e763442960e6780b8c39b5
parentcfb51f54ba8033a507a985763f0e7fc1b9b6d69f
ExpandPostRAPseudos should transfer implicit uses, not only implicit defs

Previously, we would expand:
%BL<def> = COPY %DL<kill>, %EBX<imp-use,kill>, %EBX<imp-def>
Into:
%BL<def> = MOV8rr %DL<kill>, %EBX<imp-def>
Dropping the imp-use on the floor.

That confused CriticalAntiDepBreaker, which (correctly) assumes that if an
instruction defs but doesn't use a register, that register is dead immediately
before the instruction - while in this case, the high lanes of EBX can be very
much alive.

This fixes PR28560.

Differential Revision: https://reviews.llvm.org/D22425

llvm-svn: 275634
llvm/lib/CodeGen/ExpandPostRAPseudos.cpp
llvm/test/CodeGen/ARM/twoaddrinstr.ll
llvm/test/CodeGen/X86/pr28560.ll [new file with mode: 0644]