This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] gfx1010 Avoid SMEM WAR hazard for some s_waitcnt values
ClosedPublic

Authored by critson on May 17 2019, 2:55 AM.

Details

Summary

Avoid introducing hazard mitigation when lgkmcnt is reduced to 0.
Clarify code comments to explain assumptions made for this hazard
mitigation. Expand and correct test cases to cover variants of
s_waitcnt.

Diff Detail

Repository
rL LLVM

Event Timeline

critson created this revision.May 17 2019, 2:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2019, 2:55 AM
arsenm added inline comments.May 17 2019, 4:28 AM
lib/Target/AMDGPU/GCNHazardRecognizer.cpp
931 ↗(On Diff #200006)

No else after return

rampitec added inline comments.May 17 2019, 9:45 AM
lib/Target/AMDGPU/GCNHazardRecognizer.cpp
927 ↗(On Diff #200006)

I believe you still can immediately bail if it is no SOPP.

927 ↗(On Diff #200006)

Can you move that logic into the switch below?

936 ↗(On Diff #200006)

You can use a single return with '||'.

critson updated this revision to Diff 200142.May 18 2019, 3:41 AM

Integrate all cases into switch statement.

critson marked 3 inline comments as done.May 18 2019, 3:42 AM
critson marked an inline comment as done.May 18 2019, 3:45 AM
critson added inline comments.
lib/Target/AMDGPU/GCNHazardRecognizer.cpp
927 ↗(On Diff #200006)

S_WAITCNT is SOPP, so this test needs to be after evaluating S_WAITCNT.

This revision is now accepted and ready to land.May 18 2019, 8:54 AM
This revision was automatically updated to reflect the committed changes.