Previous debug info fix to this code wasn't quite
authorDale Johannesen <dalej@apple.com>
Thu, 12 Mar 2009 23:18:09 +0000 (23:18 +0000)
committerDale Johannesen <dalej@apple.com>
Thu, 12 Mar 2009 23:18:09 +0000 (23:18 +0000)
right; did the wrong thing when there are exactly 11
non-debug instructions, followed by debug info.
Remove a FIXME since it's apparently been fixed along the way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66840 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/SimplifyCFG.cpp

index 637fab0bf0ea4029c5edae4061ab9fa749d9ed09..b8bac6da2febe80689db319b9b8a0ce5acc124c8 100644 (file)
@@ -1122,14 +1122,13 @@ static bool BlockIsSimpleEnoughToThreadThrough(BasicBlock *BB) {
   BranchInst *BI = cast<BranchInst>(BB->getTerminator());
   unsigned Size = 0;
   
-  // If this basic block contains anything other than a PHI (which controls the
-  // branch) and branch itself, bail out.  FIXME: improve this in the future.
   for (BasicBlock::iterator BBI = BB->begin(); &*BBI != BI; ++BBI) {
+    if (isa<DbgInfoIntrinsic>(BBI))
+      continue;
     if (Size > 10) return false;  // Don't clone large BB's.
-    if (!isa<DbgInfoIntrinsic>(BBI))
-      ++Size;
+    ++Size;
     
-    // We can only support instructions that are do not define values that are
+    // We can only support instructions that do not define values that are
     // live outside of the current basic block.
     for (Value::use_iterator UI = BBI->use_begin(), E = BBI->use_end();
          UI != E; ++UI) {