This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix replacing idxen mubuf instructions with addr64
AbandonedPublic

Authored by arsenm on Aug 11 2016, 5:13 PM.

Details

Reviewers
tstellarAMD
Summary

This is still broken for VI like the other cases handled here.
These can't use the workaround of using flat for global memory.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 67778.Aug 11 2016, 5:13 PM
arsenm retitled this revision from to AMDGPU: Fix replacing idxen mubuf instructions with addr64.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
lib/Target/AMDGPU/SIInstrInfo.cpp
2531–2539

The legalization is more complicated because we need to check the stride and tid_enable bits on the resource and do:

ptr = ptr + (stride * (index + tid))

I think instead of lowering this, we should try harder to put the base pointer in SGPRs, though I'm not sure of a good way to do that.

arsenm added inline comments.Nov 15 2016, 2:58 PM
lib/Target/AMDGPU/SIInstrInfo.cpp
2531–2539

Figuring out the TID here is a problem. If it was just the VGPR0 input, a copy could be inserted in the entry block of the input argument to use here, but then we don't know if the y and z components need to be added, which might not even be enabled inputs yet at this point.

arsenm abandoned this revision.Feb 21 2019, 6:48 PM