[PATCH] D63952: [LoopBase] Strengthen isLoopExiting by requiring that BB must be inside the loop.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 13:17:40 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL365077: [LoopBase] Strengthen isLoopExiting by requiring that BB must be inside theā€¦ (authored by fhahn, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D63952?vs=207233&id=207872#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D63952

Files:
  llvm/trunk/include/llvm/Analysis/LoopInfo.h


Index: llvm/trunk/include/llvm/Analysis/LoopInfo.h
===================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h
@@ -201,9 +201,10 @@
   }
 
   /// True if terminator in the block can branch to another block that is
-  /// outside of the current loop.
+  /// outside of the current loop. \p BB must be inside the loop.
   bool isLoopExiting(const BlockT *BB) const {
     assert(!isInvalid() && "Loop not in a valid state!");
+    assert(contains(BB) && "Exiting block must be part of the loop");
     for (const auto &Succ : children<const BlockT *>(BB)) {
       if (!contains(Succ))
         return true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63952.207872.patch
Type: text/x-patch
Size: 710 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190703/f0a28188/attachment.bin>


More information about the llvm-commits mailing list