OSDN Git Service

[AMDGPU] New buffer intrinsics
authorTim Renouf <tpr.llvm@botech.co.uk>
Tue, 21 Aug 2018 11:07:10 +0000 (11:07 +0000)
committerTim Renouf <tpr.llvm@botech.co.uk>
Tue, 21 Aug 2018 11:07:10 +0000 (11:07 +0000)
commita53b9eb46e85df94031aeb3800df590b3d05df5d
treec855671579425ae97211de3cb9da9f5b4852621d
parent12c4e30c78af3beb746e0e8b6c4bd234914fab43
[AMDGPU] New buffer intrinsics

Summary:
This commit adds new intrinsics
  llvm.amdgcn.raw.buffer.load
  llvm.amdgcn.raw.buffer.load.format
  llvm.amdgcn.raw.buffer.load.format.d16
  llvm.amdgcn.struct.buffer.load
  llvm.amdgcn.struct.buffer.load.format
  llvm.amdgcn.struct.buffer.load.format.d16
  llvm.amdgcn.raw.buffer.store
  llvm.amdgcn.raw.buffer.store.format
  llvm.amdgcn.raw.buffer.store.format.d16
  llvm.amdgcn.struct.buffer.store
  llvm.amdgcn.struct.buffer.store.format
  llvm.amdgcn.struct.buffer.store.format.d16
  llvm.amdgcn.raw.buffer.atomic.*
  llvm.amdgcn.struct.buffer.atomic.*

with the following changes from the llvm.amdgcn.buffer.*
intrinsics:

* there are separate raw and struct versions: raw does not have an
  index arg and sets idxen=0 in the instruction, and struct always sets
  idxen=1 in the instruction even if the index is 0, to allow for the
  fact that gfx9 does bounds checking differently depending on whether
  idxen is set;

* there is a combined cachepolicy arg (glc+slc)

* there are now only two offset args: one for the offset that is
  included in bounds checking and swizzling, to be split between the
  instruction's voffset and immoffset fields, and one for the offset
  that is excluded from bounds checking and swizzling, to go into the
  instruction's soffset field.

The AMDISD::BUFFER_* SD nodes always have an index operand, all three
offset operands, combined cachepolicy operand, and an extra idxen
operand.

The obsolescent llvm.amdgcn.buffer.* intrinsics continue to work.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, jfb, llvm-commits

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

Change-Id: If897ea7dc34fcbf4d5496e98cc99a934f62fc205

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340269 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/IR/IntrinsicsAMDGPU.td
lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
lib/Target/AMDGPU/BUFInstructions.td
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIISelLowering.h
lib/Target/AMDGPU/SIInstrInfo.td
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.atomic.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.load.format.d16.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.load.format.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.load.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.store.format.d16.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.store.format.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.store.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.atomic.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.load.format.d16.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.load.format.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.load.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.store.format.d16.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.store.format.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.struct.buffer.store.ll [new file with mode: 0644]