From: Tom Stellard Date: Mon, 2 May 2016 19:37:56 +0000 (+0000) Subject: AMDGPU/SI: Set the kill flag on temp VGPRs used to restore SGPRs from scratch X-Git-Tag: android-x86-7.1-r4~34164 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c82cf31b47a2b9d191343748f4a7123673d47f31;p=android-x86%2Fexternal-llvm.git AMDGPU/SI: Set the kill flag on temp VGPRs used to restore SGPRs from scratch Summary: When we restore an SGPR value from scratch, we first load it into a temporary VGPR and then use v_readlane_b32 to copy the value from the VGPR back into an SGPR. We weren't setting the kill flag on the VGPR in the v_readlane_b32 instruction, so the register scavenger wasn't able to re-use this temp value later. I wasn't able to create a lit test for this. Reviewers: arsenm Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D19744 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268287 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/SIRegisterInfo.cpp b/lib/Target/AMDGPU/SIRegisterInfo.cpp index d0ba8e68507..9012b3110b3 100644 --- a/lib/Target/AMDGPU/SIRegisterInfo.cpp +++ b/lib/Target/AMDGPU/SIRegisterInfo.cpp @@ -590,7 +590,7 @@ void SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI, .addMemOperand(MMO); BuildMI(*MBB, MI, DL, TII->getMCOpcodeFromPseudo(AMDGPU::V_READLANE_B32), SubReg) - .addReg(TmpReg) + .addReg(TmpReg, RegState::Kill) .addImm(0) .addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine); }