AMDGPU: use ComplexPattern for offsets in llvm.amdgcn.buffer.load/store.format
authorNicolai Haehnle <nhaehnle@gmail.com>
Fri, 18 Mar 2016 16:24:20 +0000 (16:24 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Fri, 18 Mar 2016 16:24:20 +0000 (16:24 +0000)
commit3003ba00a3260bdee71dd802bcfa970c3580e6bb
tree2ee90f91725b6c097dbf0def5e621966580566e2
parenta74cd526e9b273f1ca99793e62dfb6d1396bf6b3
AMDGPU: use ComplexPattern for offsets in llvm.amdgcn.buffer.load/store.format

Summary:
We cannot easily deduce that an offset is in an SGPR, but the Mesa frontend
cannot easily make use of an explicit soffset parameter either. Furthermore,
it is likely that in the future, LLVM will be in a better position than the
frontend to choose an SGPR offset if possible.

Since there aren't any frontend uses of these intrinsics in upstream
repositories yet, I would like to take this opportunity to change the
intrinsic signatures to a single offset parameter, which is then selected
to immediate offsets or voffsets using a ComplexPattern.

Reviewers: arsenm, tstellarAMD, mareko

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D18218

llvm-svn: 263790
llvm/include/llvm/IR/IntrinsicsAMDGPU.td
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.td
llvm/lib/Target/AMDGPU/SIInstructions.td
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.buffer.load.format.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.buffer.store.format.ll