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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 08:42:22 PST 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1654
+
+  for (MachineLoop *const LI : *MLI) {
+    if (LI->getLoopPreheader() != &MBB)
----------------
I think the definition of a preheader is that it has a single successor, which is the header. So you should not have to search through all loops in the function here, just look up the loop for MBB's successor and then walk up its parents.


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