[PATCH] D115747: [AMDGPU] Flush the vmcnt counter in loop preheader when necessary

Baptiste Saleil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 06:42:21 PDT 2022


bsaleil added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:448
+      AMDGPU::Waitcnt Wait,
+      std::function<MachineBasicBlock::instr_iterator()> GetIterator,
+      MachineBasicBlock &Block, WaitcntBrackets &ScoreBrackets,
----------------
foad wrote:
> Why can't you just pass in an iterator? As Nicolai said, they should not get invalidated.
Couldn't the iterator be invalidated by the call to `applyPreexistingWaitcnt` since we `eraseFromParent()` in it ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115747



More information about the llvm-commits mailing list