[llvm] r268287 - AMDGPU/SI: Set the kill flag on temp VGPRs used to restore SGPRs from scratch

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 12:37:56 PDT 2016


Author: tstellar
Date: Mon May  2 14:37:56 2016
New Revision: 268287

URL: http://llvm.org/viewvc/llvm-project?rev=268287&view=rev
Log:
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

Modified:
    llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp?rev=268287&r1=268286&r2=268287&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp Mon May  2 14:37:56 2016
@@ -590,7 +590,7 @@ void SIRegisterInfo::eliminateFrameIndex
                   .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);
         }




More information about the llvm-commits mailing list