aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
authorAlexander Timofeev <Alexander.Timofeev@amd.com>2017-10-16 16:57:37 +0000
committerAlexander Timofeev <Alexander.Timofeev@amd.com>2017-10-16 16:57:37 +0000
commit9dff31c7692c8e9c22c68e89d19d74cf38d4a747 (patch)
treed462642efe99324540c1731ddc1ef27cd6cb2de7 /llvm/lib/CodeGen/MachineCopyPropagation.cpp
parent9b3d6272800a2390eebfb9f3cd9d33523908d553 (diff)
downloadllvm-9dff31c7692c8e9c22c68e89d19d74cf38d4a747.zip
llvm-9dff31c7692c8e9c22c68e89d19d74cf38d4a747.tar.gz
llvm-9dff31c7692c8e9c22c68e89d19d74cf38d4a747.tar.bz2
[AMDGPU] : revert r315908
llvm-svn: 315916
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCopyPropagation.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 030db43..61f56ff 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -275,20 +275,18 @@ void MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
ClobberRegister(Reg);
}
- if (!MI->getOperand(0).isDead() && !MI->getOperand(1).isUndef()) {
- // Remember Def is defined by the copy.
- for (MCSubRegIterator SR(Def, TRI, /*IncludeSelf=*/true); SR.isValid();
- ++SR) {
- CopyMap[*SR] = MI;
- AvailCopyMap[*SR] = MI;
- }
+ // Remember Def is defined by the copy.
+ for (MCSubRegIterator SR(Def, TRI, /*IncludeSelf=*/true); SR.isValid();
+ ++SR) {
+ CopyMap[*SR] = MI;
+ AvailCopyMap[*SR] = MI;
+ }
- // Remember source that's copied to Def. Once it's clobbered, then
- // it's no longer available for copy propagation.
- RegList &DestList = SrcMap[Src];
- if (!is_contained(DestList, Def))
+ // Remember source that's copied to Def. Once it's clobbered, then
+ // it's no longer available for copy propagation.
+ RegList &DestList = SrcMap[Src];
+ if (!is_contained(DestList, Def))
DestList.push_back(Def);
- }
continue;
}