This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][InsertWaits] No wait for WAW for global/scratch_load
ClosedPublic

Authored by ruiling on Nov 21 2022, 11:02 PM.

Details

Summary

global/scratch_load will return in order they are issued. No
need to insert a s_waitcnt for WAW hazard.

Diff Detail

Event Timeline

ruiling created this revision.Nov 21 2022, 11:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 11:02 PM
ruiling requested review of this revision.Nov 21 2022, 11:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 21 2022, 11:02 PM
foad accepted this revision.Nov 22 2022, 2:41 AM

LGTM. @nhaehnle already explained offline that the basic idea is sound.

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
144

I guess this is OK but it I really don't know what we mean by "VMEM" any more.

152

I don't think you need to change this line. Global and scratch will already fail the isMIMG test.

1190

Don't need the outer parentheses here.

This revision is now accepted and ready to land.Nov 22 2022, 2:41 AM
ruiling added inline comments.Nov 22 2022, 4:03 AM
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
144

Do you feel it better to be updateVMCntOnly()?

152

Yes, I did not realize it. Thanks!

1190

will fix.

foad added inline comments.Nov 22 2022, 4:06 AM
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
144

Yes, good idea.

Since this change one of our bots has been timing out trying to build SIInsertWaitcnts.cpp https://lab.llvm.org/buildbot/#/builders/182/builds/4502.

Not your problem, but just so you know you can ignore the failure email. We will find the underlying issue ourselves.