[PATCH] D130313: [AMDGPU] Avoid flushing the vmcnt counter in loop preheaders if not necessary

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 09:26:43 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1733
         // Vgpr use
         if (Op.isUse()) {
           for (int RegNo = Interval.first; RegNo < Interval.second; ++RegNo) {
----------------
foad wrote:
> Maybe use `.readsReg()` here? See comments about `undef` in the test case. (Note that readsReg is not mutually exclusive with isDef, since a subreg def operand both reads and writes the undeerlying super reg. So you might also need to remove the "else" on line 1752.)
Sorry but I think I was wrong to suggest readsReg. A subreg write operand is "readsReg" because it "reads" the other subregs of the superreg, but for the purposes of waitcnt insertion we should not consider it as a read operand. So I think you don't need any change on line 1729 after all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130313/new/

https://reviews.llvm.org/D130313



More information about the llvm-commits mailing list