From: Matt Arsenault Date: Mon, 12 Jun 2017 17:19:20 +0000 (+0000) Subject: AMDGPU: Don't add same implicit use multiple times X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cae1d2455446de915a8c50d2fd772681aff10bc;p=llvm AMDGPU: Don't add same implicit use multiple times For the last component, the same register use was added as an implicit use and another implicit kill use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305205 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/SIInstrInfo.cpp b/lib/Target/AMDGPU/SIInstrInfo.cpp index d206a5ec9d5..1097814e99c 100644 --- a/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -468,13 +468,11 @@ void SIInstrInfo::copyPhysReg(MachineBasicBlock &MBB, Builder.addReg(RI.getSubReg(SrcReg, SubIdx)); - if (Idx == SubIndices.size() - 1) - Builder.addReg(SrcReg, getKillRegState(KillSrc) | RegState::Implicit); - if (Idx == 0) Builder.addReg(DestReg, RegState::Define | RegState::Implicit); - Builder.addReg(SrcReg, RegState::Implicit); + bool UseKill = KillSrc && Idx == SubIndices.size() - 1; + Builder.addReg(SrcReg, getKillRegState(UseKill) | RegState::Implicit); } }