[PATCH] D66529: [LOOPGUARD] Disable loop with multiple loop exiting blocks.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 13:26:53 PDT 2019


Meinersbur added a comment.

Any reason not to use `Loop::getExitBlock()`? The behavior is different when there are are multiple exiting edges to the same block, but does it matter? Maybe we should change `Loop::getExitBlock()` to only return `nullptr` if two different exit blocks exist, as e.g. `getLoopPredecessor()` already does.



================
Comment at: llvm/lib/Analysis/LoopInfo.cpp:378
+  BasicBlock *ExitFromLatch = ExitBlocks.front();
+  assert(ExitFromLatch && "Expecting valid exit block from the loop latch");
+
----------------
I think that `getUniqueExitBlocks` never adds nullptr elements anyway. However, asserts don't hurt.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66529





More information about the llvm-commits mailing list