[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles
authorJustin Bogner <mail@justinbogner.com>
Thu, 14 Jun 2018 18:32:55 +0000 (18:32 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 14 Jun 2018 18:32:55 +0000 (18:32 +0000)
commit866d9f02be2337ad1c540ccecd0541ffcf6274eb
tree6ea4f80d58ec3b79ec7585a173b33b37de8ecdf0
parentc9b41354fffa9dd88f55439d41d2e6908fd4d5fd
[VirtRegRewriter] Avoid clobbering registers when expanding copy bundles

If a copy bundle happens to involve overlapping registers, we can end
up with emitting the copies in an order that ends up clobbering some
of the subregisters. Since instructions in the copy bundle
semantically happen at the same time, this is incorrect and we need to
make sure we order the copies such that this doesn't happen.

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

llvm-svn: 334750
llvm/lib/CodeGen/VirtRegMap.cpp
llvm/test/CodeGen/AArch64/overlapping-copy-bundle-cycle.mir [new file with mode: 0644]
llvm/test/CodeGen/AArch64/overlapping-copy-bundle.mir [new file with mode: 0644]