This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix S_BUFFER_LOAD_DWORD_SGPR moveToVALU.
ClosedPublic

Authored by bnieuwenhuizen on Feb 3 2018, 5:52 AM.

Details

Summary

It moves the offset to vgpr, but did not handle being called for
any of the other arguments, while LLVM 5 would select
BUFFER_LOAD_DWORD_OFFEN immediately, which does the right thing.

This calls legalizeOperands to fix up the operands after we converted
to a BUFFER_LOAD_DWORD_OFFEN.

Diff Detail

Event Timeline

bnieuwenhuizen created this revision.Feb 3 2018, 5:52 AM
mareko added a comment.Feb 3 2018, 6:19 AM

Is this supposed to just insert v_readfirstlane for the descriptor? Can you mention that in the comment before calling legalizeOperands? Can you add a test case? Thanks.

Adjusted the comment and added a testcase.

The testcase did not turn out to be as simple as I'd hoped, mostly
because you need to trick the structurizer into generating a phi
that results in vgprs for the descriptor.

mareko accepted this revision.Feb 3 2018, 5:59 PM
This revision is now accepted and ready to land.Feb 3 2018, 5:59 PM

Would it be possible to commit this for me again?

mareko closed this revision.Feb 6 2018, 7:21 AM

Pushed, thanks.