From f6eb7ff7f852171aceac7649d7d4d12d37807854 Mon Sep 17 00:00:00 2001 From: Alexander Timofeev Date: Mon, 16 Oct 2017 16:57:37 +0000 Subject: [PATCH] [AMDGPU] : revert r315908 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315916 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineCopyPropagation.cpp | 22 ++++++++++----------- test/CodeGen/AMDGPU/dead_copy.mir | 27 -------------------------- 2 files changed, 10 insertions(+), 39 deletions(-) delete mode 100644 test/CodeGen/AMDGPU/dead_copy.mir diff --git a/lib/CodeGen/MachineCopyPropagation.cpp b/lib/CodeGen/MachineCopyPropagation.cpp index 030db4366e9..61f56fffc88 100644 --- a/lib/CodeGen/MachineCopyPropagation.cpp +++ b/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; } diff --git a/test/CodeGen/AMDGPU/dead_copy.mir b/test/CodeGen/AMDGPU/dead_copy.mir deleted file mode 100644 index 76a25f2ba80..00000000000 --- a/test/CodeGen/AMDGPU/dead_copy.mir +++ /dev/null @@ -1,27 +0,0 @@ -# RUN: llc -o - %s -march=amdgcn -mcpu=fiji -run-pass=machine-cp -verify-machineinstrs | FileCheck -check-prefix=GCN %s - -# GCN-LABEL: dead_copy -# GCN: bb.0 -# GCN-NOT: dead %vgpr5 = COPY undef %vgpr11, implicit %exec -# GCN: %vgpr5 = COPY %vgpr11, implicit %exec - ---- -name: dead_copy - -body: | - - bb.0: - liveins: %vgpr11, %sgpr0, %sgpr1, %vgpr6, %vgpr7, %vgpr4 - - dead %vgpr5 = COPY undef %vgpr11, implicit %exec - - %vgpr5 = COPY %vgpr11, implicit %exec - - %sgpr14 = S_ADD_U32 %sgpr0, target-flags(amdgpu-gotprel) 1136, implicit-def %scc - %sgpr15 = S_ADDC_U32 %sgpr1, target-flags(amdgpu-gotprel32-lo) 0, implicit-def dead %scc, implicit %scc - - %vgpr10 = COPY killed %sgpr14, implicit %exec - %vgpr11 = COPY killed %sgpr15, implicit %exec - - FLAT_STORE_DWORDX4 %vgpr10_vgpr11, %vgpr4_vgpr5_vgpr6_vgpr7, 0, 0, 0, implicit %exec, implicit %flat_scr -... -- 2.40.0