[TailDuplicator] Fix copy instruction emitting into the wrong block.
authorAmara Emerson <aemerson@apple.com>
Tue, 2 Jul 2019 06:04:46 +0000 (06:04 +0000)
committerAmara Emerson <aemerson@apple.com>
Tue, 2 Jul 2019 06:04:46 +0000 (06:04 +0000)
commit000ef2c2ae0752ae97a99db8dabada7ca2f480f3
tree75aaaecac224fb187d67edc166111fd85cb8220d
parent2d306b2d57f22cc94cca3f83ee8b0d574f0a9579
[TailDuplicator] Fix copy instruction emitting into the wrong block.

The code for duplicating instructions could sometimes try to emit copies
intended to deal with unconstrainable register classes to the tail block of the
original instruction, rather than before the newly cloned instruction in the
predecessor block.

This was exposed by GlobalISel on arm64.

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

llvm-svn: 364888
llvm/lib/CodeGen/TailDuplicator.cpp
llvm/test/CodeGen/AArch64/taildup-inst-dup-loc.mir [new file with mode: 0644]