[PATCH] D19745: AMDGPU/SI: Use v_readfirstlane_b32 when restoring SGPRs spilled to scratch

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 14:05:20 PDT 2016


tstellarAMD created this revision.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
Herald added a subscriber: arsenm.

We were using v_readlane_b32 with the lane set to zero, but this won't
work if thread 0 is not active.

http://reviews.llvm.org/D19745

Files:
  lib/Target/AMDGPU/SIRegisterInfo.cpp

Index: lib/Target/AMDGPU/SIRegisterInfo.cpp
===================================================================
--- lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -589,9 +589,8 @@
                   .addImm(i * 4)                          // offset
                   .addMemOperand(MMO);
           BuildMI(*MBB, MI, DL,
-                  TII->getMCOpcodeFromPseudo(AMDGPU::V_READLANE_B32), SubReg)
+                  TII->get(AMDGPU::V_READFIRSTLANE_B32), SubReg)
                   .addReg(TmpReg, RegState::Kill)
-                  .addImm(0)
                   .addReg(MI->getOperand(0).getReg(), RegState::ImplicitDefine);
         }
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19745.55665.patch
Type: text/x-patch
Size: 684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160429/237663c1/attachment.bin>


More information about the llvm-commits mailing list