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

Mark Searles via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 4 12:03:19 PST 2018


msearles 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
----------------
rampitec wrote:
> msearles wrote:
> > rampitec wrote:
> > > 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[]))
> > Agreed in principle, however, I have a sense that the common case is the redundant waitcnt and, moreover, the common case is redundant because of interaction with the memory legalizer. Per Tony, the existing waitcnt instrs should be left alone; it might get messy to attempt to create the strongest waitcnt instr of an existing waitcnt and a waitcnt pass waitcnt.
> We can keep it in mind for the future. I believe a more common case is wait to 0 inserted by the legalizer and wait to a higher count inserted here, so they not necessarily equal.
Agreed.


https://reviews.llvm.org/D42854





More information about the llvm-commits mailing list