[PATCH] D30182: [LoopSimplify] Simplify how we compute UniqueExit

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 11:22:42 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL295751: [LoopSimplify] Simplify how we compute UniqueExit (authored by trentxintong).

Changed prior to commit:
  https://reviews.llvm.org/D30182?vs=89150&id=89253#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30182

Files:
  llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp


Index: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
+++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
@@ -645,14 +645,7 @@
   // loop-invariant instructions out of the way to open up more
   // opportunities, and the disadvantage of having the responsibility
   // to preserve dominator information.
-  bool UniqueExit = true;
-  if (!ExitBlocks.empty())
-    for (unsigned i = 1, e = ExitBlocks.size(); i != e; ++i)
-      if (ExitBlocks[i] != ExitBlocks[0]) {
-        UniqueExit = false;
-        break;
-      }
-  if (UniqueExit) {
+  if (ExitBlockSet.size() == 1) {
     for (unsigned i = 0, e = ExitingBlocks.size(); i != e; ++i) {
       BasicBlock *ExitingBlock = ExitingBlocks[i];
       if (!ExitingBlock->getSinglePredecessor()) continue;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30182.89253.patch
Type: text/x-patch
Size: 879 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170221/a0fba2f1/attachment.bin>


More information about the llvm-commits mailing list