OSDN Git Service

AArch64: improve redundant copy elimination.
authorTim Northover <tnorthover@apple.com>
Wed, 17 Feb 2016 21:16:53 +0000 (21:16 +0000)
committerTim Northover <tnorthover@apple.com>
Wed, 17 Feb 2016 21:16:53 +0000 (21:16 +0000)
commit1753e553bfce14c0b68aace845c49d27dab9b9b4
treef75187ec8e785b0baf8fd2be9e43622c5e78292f
parent68c9756745bb533be17e47ac17c63d6590223a81
AArch64: improve redundant copy elimination.

Mostly, this fixes the bug that if the CBZ guaranteed Xn but Wn was used, we
didn't sort out the use-def chain properly.

I've also made it check more than just the last instruction for a compatible
CBZ (so it can cope without fallthroughs). I'd have liked to do that
separately, but it's helps writing the test.

Finally, I removed some custom loops in favour of MachineInstr helpers and
refactored the control flow to flatten it and avoid possibly quadratic
iterations in blocks with many copies. NFC for these, just a general tidy-up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261154 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64RedundantCopyElimination.cpp
test/CodeGen/AArch64/machine-copy-remove.ll