diff options
author | Amara Emerson <aemerson@apple.com> | 2019-07-02 06:04:46 +0000 |
---|---|---|
committer | Amara Emerson <aemerson@apple.com> | 2019-07-02 06:04:46 +0000 |
commit | 000ef2c2ae0752ae97a99db8dabada7ca2f480f3 (patch) | |
tree | 75aaaecac224fb187d67edc166111fd85cb8220d /llvm/lib/CodeGen/TailDuplicator.cpp | |
parent | 2d306b2d57f22cc94cca3f83ee8b0d574f0a9579 (diff) | |
download | bcm5719-llvm-000ef2c2ae0752ae97a99db8dabada7ca2f480f3.tar.gz bcm5719-llvm-000ef2c2ae0752ae97a99db8dabada7ca2f480f3.zip |
[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
Diffstat (limited to 'llvm/lib/CodeGen/TailDuplicator.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TailDuplicator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp index 4d3e02e3174..a0590a8a6cc 100644 --- a/llvm/lib/CodeGen/TailDuplicator.cpp +++ b/llvm/lib/CodeGen/TailDuplicator.cpp @@ -434,7 +434,7 @@ void TailDuplicator::duplicateInstruction( if (NewRC == nullptr) NewRC = OrigRC; unsigned NewReg = MRI->createVirtualRegister(NewRC); - BuildMI(*PredBB, MI, MI->getDebugLoc(), + BuildMI(*PredBB, NewMI, NewMI.getDebugLoc(), TII->get(TargetOpcode::COPY), NewReg) .addReg(VI->second.Reg, 0, VI->second.SubReg); LocalVRMap.erase(VI); |