AMDGPU: Fix emitting invalid workitem intrinsics for HSA
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 30 Jan 2016 05:19:45 +0000 (05:19 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 30 Jan 2016 05:19:45 +0000 (05:19 +0000)
commite013246462fe620bc668faf0f5a9bd959098563a
tree4295fe592b2a89cded2157e9291d6333576e9478
parentd0799df7075c549611a8da06e4a7272fd82ff9c9
AMDGPU: Fix emitting invalid workitem intrinsics for HSA

The AMDGPUPromoteAlloca pass was emitting the read.local.size
calls, which with HSA was incorrectly selected to reading from
the offset mesa uses off of the kernarg pointer.

Error on intrinsics which aren't supported by HSA, and start
emitting the correct IR to read the workgroup size
out of the dispatch pointer.

Also initialize the pass so it can be tested with opt, and
start moving towards not depending on the subtarget as an
argument.

Start emitting errors for the intrinsics not handled with HSA.

llvm-svn: 259297
llvm/lib/Target/AMDGPU/AMDGPU.h
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/private-memory-r600.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/private-memory.ll