[PATCH] D83394: [AMDGPU] Avoid splitting FLAT offsets in unsafe ways

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 06:51:27 PDT 2020


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

As explained in the comment:

// For a FLAT instruction the hardware decides whether to access
// global/scratch/shared memory based on the high bits of vaddr,
// ignoring the offset field, so we have to ensure that when we add
// remainder to vaddr it still points into the same underlying object.
// The easiest way to do that is to make sure that we split the offset
// into two pieces that are both >= 0 or both <= 0.

In particular FLAT (as opposed to SCRATCH and GLOBAL) instructions have
an unsigned immediate offset field, so we can't use it to help split a
negative offset.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83394

Files:
  llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
  llvm/test/CodeGen/AMDGPU/offset-split-global.ll
  llvm/test/CodeGen/AMDGPU/promote-constOffset-to-imm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83394.276412.patch
Type: text/x-patch
Size: 13844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200708/80d79a21/attachment.bin>


More information about the llvm-commits mailing list