summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAlexander Timofeev <Alexander.Timofeev@amd.com>2017-11-10 12:21:10 +0000
committerAlexander Timofeev <Alexander.Timofeev@amd.com>2017-11-10 12:21:10 +0000
commit28da06778fb1f91f6fe854d034d75cc44a817d94 (patch)
tree259c74f17f0b8b91f94bbf6b6c26208268342b38 /llvm/lib/CodeGen
parent13cc995c3d7ce55326f255718ee1f09fb4ca8bbb (diff)
downloadbcm5719-llvm-28da06778fb1f91f6fe854d034d75cc44a817d94.tar.gz
bcm5719-llvm-28da06778fb1f91f6fe854d034d75cc44a817d94.zip
[AMDGPU] Prevent Machine Copy Propagation from replacing live copy with the dead one
Differential revision: https://reviews.llvm.org/D38754 llvm-svn: 317884
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachineCopyPropagation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 1a39afe655e..4bcb4d5b98a 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -187,6 +187,8 @@ bool MachineCopyPropagation::eraseIfRedundant(MachineInstr &Copy, unsigned Src,
// Check that the existing copy uses the correct sub registers.
MachineInstr &PrevCopy = *CI->second;
+ if (PrevCopy.getOperand(0).isDead())
+ return false;
if (!isNopCopy(PrevCopy, Src, Def, TRI))
return false;
OpenPOWER on IntegriCloud