[PATCH] D42854: [AMDGPU] Suppress redundant waitcnt instrs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 10:45:12 PST 2018


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1567
     if (SWaitInst) {
+      // We don't (yet) track waitcnts that existed prior to the waitcnt
+      // pass (we just skip over them); because the waitcnt pass is ignorant
----------------
Probably we need not to check for identity, but create a single strongest wait combined from two.

For example, one waits for vmcnt(2), another for vmcnt(3) - keep vmcnt(2).
One waits for lgkmcnt, another does not - wait for lgkmcnt.

Generalizing: produce one wait with:

s_waitcnt vmcnt(min(vmcnts[])), expcnt(min(expcnts[])), lgkmcnt(min(lgkmcnts[]))


https://reviews.llvm.org/D42854





More information about the llvm-commits mailing list