[all-commits] [llvm/llvm-project] 760af7: [AMDGPU] Avoid splitting FLAT offsets in unsafe ways

jayfoad via All-commits all-commits at lists.llvm.org
Fri Jul 17 03:46:37 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 760af7a0743278b6dd7782b177f4d6d086c726e0
      https://github.com/llvm/llvm-project/commit/760af7a0743278b6dd7782b177f4d6d086c726e0
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2020-07-17 (Fri, 17 Jul 2020)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
    M llvm/test/CodeGen/AMDGPU/flat-address-space.ll
    M llvm/test/CodeGen/AMDGPU/offset-split-flat.ll
    M llvm/test/CodeGen/AMDGPU/offset-split-global.ll
    M llvm/test/CodeGen/AMDGPU/promote-constOffset-to-imm.ll
    M llvm/test/CodeGen/AMDGPU/store-hi16.ll

  Log Message:
  -----------
  [AMDGPU] Avoid splitting FLAT offsets in unsafe ways

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.

Differential Revision: https://reviews.llvm.org/D83394




More information about the All-commits mailing list