[AArch64] Fix Copy Elemination for negative values
authorTomas Matheson <tomas.matheson@arm.com>
Fri, 18 Dec 2020 13:29:50 +0000 (13:29 +0000)
committerPaul Walker <paul.walker@arm.com>
Fri, 18 Dec 2020 13:30:46 +0000 (13:30 +0000)
commitfc712eb7aa00aabcdafda54776038efdc486d570
treeb18f41a4e4188cc6e0b7b38763b138d1928e4bae
parentc0bc169cb17397e981952dad7321b263756ddaa0
[AArch64] Fix Copy Elemination for negative values

Redundant Copy Elimination was eliminating a MOVi32imm -1 when it
determined that the value of the destination register is already -1.
However, it didn't take into account that the MOVi32imm zeroes the upper
32 bits (which are FFFFFFFF) and therefore cannot be eliminated.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D93100
llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp
llvm/test/CodeGen/AArch64/machine-copy-remove.mir