[llvm] [LoopVectorize] Use new getUniqueLatchExitBlock routine (PR #108231)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 13:43:09 PST 2024


================
@@ -159,6 +159,17 @@ BlockT *LoopBase<BlockT, LoopT>::getUniqueExitBlock() const {
   return getExitBlockHelper(this, true).first;
 }
 
+template <class BlockT, class LoopT>
+BlockT *LoopBase<BlockT, LoopT>::getUniqueLatchExitBlock() const {
+  BlockT *Latch = getLoopLatch();
+  assert(Latch && "Latch block must exists");
+  auto IsExitBlock = [&](BlockT *BB, bool AllowRepeats) -> BlockT * {
----------------
fhahn wrote:

nit: sufficient to capture `this`?
```suggestion
  auto IsExitBlock = [this](BlockT *BB, bool AllowRepeats) -> BlockT * {
```



https://github.com/llvm/llvm-project/pull/108231


More information about the llvm-commits mailing list