[PATCH] D82641: [AMDGPU] Unify early PS termination blocks

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 02:08:17 PDT 2020


critson marked 3 inline comments as done.
critson added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertSkips.cpp:222-223
+      createEarlyExitBlock(MBB);
+      // Reset iterator as next block may have changed
+      NextBBI = std::next(MBB.getIterator());
+    }
----------------
nhaehnle wrote:
> Why the update to NextBBI? The old code didn't do that, I believe on purpose because while it doesn't break correctness, there simply shouldn't be a need to inspect the EarlyExitBlock.
This update is not part of the iteration.
EarlyExitBlock is not inspected because this code is executed after the iteration of blocks.
This update is required so the SplitBB is inserted in the correct place (immediately following MBB).  Technically this is only required when NextBBI is MBB->end(), in which case the EarlyExitBlock will become the next block; however, simply resetting the iterator keeps it more generic w.r.t. EarlyExitBlock placement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82641





More information about the llvm-commits mailing list