[llvm-branch-commits] [llvm-branch] r271770 - Merging r268287:

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jun 3 20:43:07 PDT 2016

Author: tstellar
Date: Fri Jun  3 22:43:06 2016
New Revision: 271770

URL: http://llvm.org/viewvc/llvm-project?rev=271770&view=rev
Merging r268287:

r268287 | thomas.stellard | 2016-05-02 12:37:56 -0700 (Mon, 02 May 2016) | 19 lines

AMDGPU/SI: Set the kill flag on temp VGPRs used to restore SGPRs from scratch

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/branches/release_38/lib/Target/AMDGPU/SIRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_38/lib/Target/AMDGPU/SIRegisterInfo.cpp?rev=271770&r1=271769&r2=271770&view=diff
--- llvm/branches/release_38/lib/Target/AMDGPU/SIRegisterInfo.cpp (original)
+++ llvm/branches/release_38/lib/Target/AMDGPU/SIRegisterInfo.cpp Fri Jun  3 22:43:06 2016
@@ -411,7 +411,7 @@ void SIRegisterInfo::eliminateFrameIndex
           BuildMI(*MBB, MI, DL,
                   TII->getMCOpcodeFromPseudo(AMDGPU::V_READLANE_B32), SubReg)
-                  .addReg(TmpReg)
+                  .addReg(TmpReg, RegState::Kill)
                   .addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);

More information about the llvm-branch-commits mailing list