This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Move insertion of function entry waitcnt later
ClosedPublic

Authored by kerbowa on Apr 27 2021, 9:39 AM.

Details

Summary

This allows tracking these as preexisting waitcnt.

Diff Detail

Event Timeline

kerbowa created this revision.Apr 27 2021, 9:39 AM
kerbowa requested review of this revision.Apr 27 2021, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2021, 9:39 AM
foad added a subscriber: foad.Apr 27 2021, 10:01 AM
arsenm added inline comments.Apr 27 2021, 10:22 AM
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
1605

I thought we made this explicitly a property of the calling convention, so we could have this not be inserted for future conventions. I guess if this isn't checking the function for that already, it's a preexisting problem

llvm/test/CodeGen/AMDGPU/waitcnt-preexisting.mir
188–190

-NEXTs would be a bit more dependable

rampitec added inline comments.Apr 27 2021, 11:30 AM
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
1603

Modified = false;?

1610

Is this comment still relevant?

foad added inline comments.Apr 28 2021, 6:38 AM
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
1607

Typo, should be "to wait" or "to do the wait"

kerbowa updated this revision to Diff 342274.May 2 2021, 2:06 PM

Address comments.

kerbowa added inline comments.May 2 2021, 2:16 PM
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
1605

When would that waitcnt be added if it's a property of the CC? It seems like these changes could help avoid it being added twice since they would be combined.

1610

It might be, if what it's saying is that we could move this waitcnt later until the function uses callee saved registers.

This revision is now accepted and ready to land.May 3 2021, 10:23 AM
This revision was automatically updated to reflect the committed changes.