This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add options for waitcnt pass debugging; add instr count in debug output.
ClosedPublic

Authored by msearles on Nov 15 2017, 10:40 AM.

Details

Summary
-amdgpu-waitcnt-forcezero={1|0}  Force all waitcnt instrs to be emitted as s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
-amdgpu-waitcnt-forceexp=<n>  Force emit a s_waitcnt expcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcelgkm=<n> Force emit a s_waitcnt lgkmcnt(0) before the first <n> instrs
-amdgpu-waitcnt-forcevm=<n>   Force emit a s_waitcnt vmcnt(0) before the first <n> instrs

Diff Detail

Event Timeline

msearles created this revision.Nov 15 2017, 10:40 AM

This will be pretty useful. Thanks!

lib/Target/AMDGPU/SIInsertWaitcnts.cpp
426–428

tabs?

1168–1174

tabs?

1186–1189

tabs?

kzhuravl added inline comments.Nov 15 2017, 10:47 AM
lib/Target/AMDGPU/SIInsertWaitcnts.cpp
424

const?

arsenm added inline comments.Nov 15 2017, 11:56 AM
lib/Target/AMDGPU/SIInsertWaitcnts.cpp
1645

You can directly << the Inst, it doesn't need a separate print line

test/CodeGen/AMDGPU/waitcnt-debug.mir
10

You don't add CHECK as a check-prefix, so this doesn't do anything

msearles updated this revision to Diff 123080.Nov 15 2017, 2:08 PM

Adjust per reviewer comments.

msearles marked 6 inline comments as done.Nov 15 2017, 2:09 PM
kzhuravl accepted this revision.Nov 29 2017, 1:27 PM

LGTM.

This revision is now accepted and ready to land.Nov 29 2017, 1:27 PM
This revision was automatically updated to reflect the committed changes.
msearles updated this revision to Diff 126411.Dec 11 2017, 11:18 AM

Patch was submitted/reverted (caused a buildbot failure: private field 'InstCnt' is not used ); changed InstCnt to be a function-scope static instead.

msearles reopened this revision.Dec 11 2017, 11:23 AM

Reopening; patch was submitted/reverted (caused a buildbot failure: private field 'InstCnt' is not used ); changed InstCnt to be a function-scope static instead.

This revision is now accepted and ready to land.Dec 11 2017, 11:23 AM
This revision was automatically updated to reflect the committed changes.