This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Implement S_GETREG Intrinsic
ClosedPublic

Authored by cfang on Mar 4 2016, 9:39 AM.

Diff Detail

Event Timeline

cfang updated this revision to Diff 49836.Mar 4 2016, 9:39 AM
cfang retitled this revision from to AMDGPU/SI: Implement S_GETREG Intrinsic.
cfang updated this object.
cfang added reviewers: arsenm, tstellarAMD, scchan.
cfang added subscribers: llvm-commits, arsenm.
arsenm edited edge metadata.Mar 4 2016, 9:57 AM

SC has some prettier syntax for the values being read, but that can be a separate patch

include/llvm/IR/IntrinsicsAMDGPU.td
221

This needs to be read only. In special cases the call site can be marked readnone

lib/Target/AMDGPU/SIInstructions.td
2076

You should be able to put this in the instruction definition

cfang updated this revision to Diff 50061.Mar 8 2016, 11:18 AM
cfang edited edge metadata.

Update based on Matt's Comments:

  1. Use "read only" attribute for s_getreg intrinsic;
  2. Decided to use separate Pattern for the intrinsic temporarily.
cfang updated this revision to Diff 50213.Mar 9 2016, 4:07 PM

update based on Matt's Comments

  1. Create a new SOPK_32 multicalss, and rename the original one as SOPK_16 (so both are based on operand size);
  2. Move the intrinsic s_getreg_b32 pattern inside the instruction definition;
  3. Add checks for SI and CI devices in the test.
arsenm accepted this revision.Mar 9 2016, 4:13 PM
arsenm edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 9 2016, 4:13 PM
This revision was automatically updated to reflect the committed changes.