[PATCH] D77082: [AMDGPU] Handle SMRD signed offset immediate

Austin Kerbow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 12:30:27 PDT 2020


kerbowa created this revision.
kerbowa added reviewers: rampitec, arsenm.
Herald added subscribers: llvm-commits, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

This fixes a few issues related to SMRD offsets. On gfx9 and gfx10 we have a
signed byte offset immediate, however we can overflow into a negative since we
treat it as unsigned.

Also, the SMRD SOFFSET sgpr is an unsigned offset on all subtargets. We
sometimes tried to use negative values here.

Third, S_BUFFER instructions should never use a signed offset immediate.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77082

Files:
  llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
  llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
  llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
  llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-load-constant.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/smrd.ll
  llvm/test/CodeGen/AMDGPU/smrd.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77082.253663.patch
Type: text/x-patch
Size: 23643 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200330/f19d2417/attachment-0001.bin>


More information about the llvm-commits mailing list