This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs
ClosedPublic

Authored by tstellarAMD on Feb 10 2016, 2:24 PM.

Details

Summary

It's possible to have resource descriptors and samplers stored in
VGPRs, either by a VMEM instruction or in the case of samplers,
floating-point calculations. When this happens, we need to use
v_readfirstlane to copy these values back to sgprs.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs.
tstellarAMD updated this object.
tstellarAMD added reviewers: arsenm, mareko.
tstellarAMD added a subscriber: llvm-commits.
mareko edited edge metadata.Feb 10 2016, 2:46 PM

Thanks. This looks good to me. Though I'll let Matt ack this.

arsenm accepted this revision.Feb 10 2016, 2:57 PM
arsenm edited edge metadata.

LGTM

lib/Target/AMDGPU/SIInstrInfo.cpp
1948 ↗(On Diff #47529)

I think the name of this should be changed to not say copy, and involve readline. readlaneToSGPR?

This revision is now accepted and ready to land.Feb 10 2016, 2:57 PM
This revision was automatically updated to reflect the committed changes.