MachineInstr: Respect register aliases in clearRegiserKills()
authorMatthias Braun <matze@braunis.de>
Wed, 24 Feb 2016 19:21:48 +0000 (19:21 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 24 Feb 2016 19:21:48 +0000 (19:21 +0000)
commitaca625a4fe812a13c1f4718996b0460d6e4d1faf
tree0d0539b97cfb1a9a43294e257fb691791e538abb
parente7e7c98f0bf081baa70ec505c9111dc655e75517
MachineInstr: Respect register aliases in clearRegiserKills()

This fixes bugs in copy elimination code in llvm. It slightly changes the
semantics of clearRegisterKills(). This is appropriate because:
- Users in lib/CodeGen/MachineCopyPropagation.cpp and
  lib/Target/AArch64RedundantCopyElimination.cpp and
  lib/Target/SystemZ/SystemZElimCompare.cpp are incorrect without it
  (see included testcase).
- All other users in llvm are unaffected (they pass TRI==nullptr)
- (Kill flags are optional anyway so removing too many shouldn't hurt.)

Differential Revision: http://reviews.llvm.org/D17554

llvm-svn: 261763
llvm/include/llvm/CodeGen/MachineInstr.h
llvm/lib/CodeGen/MachineInstr.cpp
llvm/test/CodeGen/X86/machine-copy-prop.mir [new file with mode: 0644]