AMDGPU: Fix legalization of MUBUF instructions in shaders
authorNicolai Haehnle <nhaehnle@gmail.com>
Fri, 18 Nov 2016 11:55:52 +0000 (11:55 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Fri, 18 Nov 2016 11:55:52 +0000 (11:55 +0000)
commitce2b589df5e5eaa0ea90e58fb439bdec034d7c0c
tree24c3df70b59303a13a4f63e095a8ce584e6754e5
parentdcd8433597238c67b1298f3703a9f53fd482d68f
AMDGPU: Fix legalization of MUBUF instructions in shaders

Summary:
The addr64-based legalization is incorrect for MUBUF instructions with idxen
set as well as for BUFFER_LOAD/STORE_FORMAT_* instructions.  This affects
e.g.  shaders that access buffer textures.

Since we never actually need the addr64-legalization in shaders, this patch
takes the easy route and keys off the calling convention.  If this ever
affects (non-OpenGL) compute, the type of legalization needs to be chosen
based on some TSFlag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98664

Reviewers: arsenm, tstellarAMD

Subscribers: kzhuravl, wdng, yaxunl, tony-tye, llvm-commits

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

llvm-svn: 287339
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/test/CodeGen/AMDGPU/mubuf-shader-vgpr.ll [new file with mode: 0644]