OSDN Git Service

[AArch64] Redundant Copy Elimination - remove more zero copies.
authorChad Rosier <mcrosier@codeaurora.org>
Sun, 23 Jul 2017 16:38:08 +0000 (16:38 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Sun, 23 Jul 2017 16:38:08 +0000 (16:38 +0000)
commitda549096f82ad32fc568d30c78168f8505467e12
tree8be5ffdee7255365dddecb87d06fa46584227fec
parent33ec7a1ff082803fe71cc532ee5f11472a427878
[AArch64] Redundant Copy Elimination - remove more zero copies.

This patch removes unnecessary zero copies in BBs that are targets of b.eq/b.ne
and we know the result of the compare instruction is zero.  For example,

BB#0:
  subs w0, w1, w2
  str w0, [x1]
  b.ne .LBB0_2
BB#1:
  mov w0, wzr  ; <-- redundant
  str w0, [x2]
.LBB0_2

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308849 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64RedundantCopyElimination.cpp
test/CodeGen/AArch64/machine-zero-copy-remove.mir [new file with mode: 0644]