Skip to content

Commit

Permalink
AMDGPU/SI: Set the kill flag on temp VGPRs used to restore SGPRs from…
Browse files Browse the repository at this point in the history
… 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

llvm-svn: 268287
  • Loading branch information
tstellarAMD committed May 2, 2016
1 parent 4f8d21f commit ce5e994
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ce5e994

Please sign in to comment.