This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix legalization of MUBUF instructions in shaders
ClosedPublic

Authored by nhaehnle on Nov 16 2016, 7:04 AM.

Details

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

Diff Detail

Repository
rL LLVM

Event Timeline

nhaehnle updated this revision to Diff 78185.Nov 16 2016, 7:04 AM
nhaehnle retitled this revision from to AMDGPU: Fix legalization of MUBUF instructions in shaders.
nhaehnle updated this object.
nhaehnle added reviewers: arsenm, tstellarAMD.
nhaehnle added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Nov 17 2016, 7:05 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Nov 17 2016, 7:05 PM
arsenm added inline comments.Nov 17 2016, 9:04 PM
test/CodeGen/AMDGPU/mubuf-shader-vgpr.ll
49–50 ↗(On Diff #78185)

This declaration isn't used

This revision was automatically updated to reflect the committed changes.