This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fixed wait count reuse
ClosedPublic

Authored by rampitec on Feb 6 2018, 5:54 PM.

Details

Summary

The code reusing existing wait counts is incorrect since it keeps
adding new operands to an old instruction instead of replacing
the immediate. It was also effectively switched off by the condition
that wait count is not an AMDGPU::S_WAITCNT.

Also switched to BuildMI instead of creating instructions directly.

Diff Detail

Event Timeline

rampitec created this revision.Feb 6 2018, 5:54 PM
msearles accepted this revision.Feb 6 2018, 6:27 PM

LGTM; what about a test that exercises the code that was effectively turned off (~line 1129)?

This revision is now accepted and ready to land.Feb 6 2018, 6:27 PM

LGTM; what about a test that exercises the code that was effectively turned off (~line 1129)?

5 of our existing lit tests hit those lines when enabled and reuse an existing instruction.

rampitec updated this revision to Diff 133238.Feb 7 2018, 9:47 AM

Rebased and merged with rL324440.

This revision was automatically updated to reflect the committed changes.