<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Are you sure?  I think that's the same test that's been failing intermittently.  Daniel tried to fix it (see <a href="http://llvm.org/bugs/show_bug.cgi?id=6753">http://llvm.org/bugs/show_bug.cgi?id=6753</a>) but I think I also saw a comment from him that it wasn't really fixed.<div><br><div><div>On Mar 31, 2010, at 4:26 PM, Bill Wendling wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: void<br>Date: Wed Mar 31 18:26:26 2010<br>New Revision: 100062<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=100062&view=rev">http://llvm.org/viewvc/llvm-project?rev=100062&view=rev</a><br>Log:<br>Revert r100056. It was causing a failure on MSVC.<br><br>Modified:<br>    llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp<br><br>Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=100062&r1=100061&r2=100062&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=100062&r1=100061&r2=100062&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Wed Mar 31 18:26:26 2010<br>@@ -23,7 +23,6 @@<br> #include "llvm/Target/TargetMachine.h"<br> #include "llvm/Assembly/Writer.h"<br> #include "llvm/ADT/SmallString.h"<br>-#include "llvm/ADT/SmallPtrSet.h"<br> #include "llvm/Support/Debug.h"<br> #include "llvm/Support/LeakDetector.h"<br> #include "llvm/Support/raw_ostream.h"<br>@@ -460,41 +459,54 @@<br>   //    conditional branch followed by an unconditional branch. DestA is the<br>   //    'true' destination and DestB is the 'false' destination.<br><br>-  bool Changed = false;<br>+  bool MadeChange = false;<br>+  bool AddedFallThrough = false;<br><br>   MachineFunction::iterator FallThru =<br>     llvm::next(MachineFunction::iterator(this));<br>-<br>-  if (DestA == 0 && DestB == 0) {<br>-    // Block falls through to successor.<br>-    DestA = FallThru;<br>-    DestB = FallThru;<br>-  } else if (DestA != 0 && DestB == 0) {<br>-    if (isCond)<br>-      // Block ends in conditional jump that falls through to successor.<br>+  <br>+  if (isCond) {<br>+    // If this block ends with a conditional branch that falls through to its<br>+    // successor, set DestB as the successor.<br>+    if (DestB == 0 && FallThru != getParent()->end()) {<br>       DestB = FallThru;<br>+      AddedFallThrough = true;<br>+    }<br>   } else {<br>-    assert(DestA && DestB && isCond &&<br>-           "CFG in a bad state. Cannot correct CFG edges");<br>+    // If this is an unconditional branch with no explicit dest, it must just be<br>+    // a fallthrough into DestA.<br>+    if (DestA == 0 && FallThru != getParent()->end()) {<br>+      DestA = FallThru;<br>+      AddedFallThrough = true;<br>+    }<br>   }<br>-<br>-  // Remove superfluous edges. I.e., those which aren't destinations of this<br>-  // basic block, duplicate edges, or landing pads.<br>-  SmallPtrSet<const MachineBasicBlock*, 8> SeenMBBs;<br>+  <br>   MachineBasicBlock::succ_iterator SI = succ_begin();<br>+  MachineBasicBlock *OrigDestA = DestA, *OrigDestB = DestB;<br>   while (SI != succ_end()) {<br>     const MachineBasicBlock *MBB = *SI;<br>-    if (!SeenMBBs.insert(MBB) ||<br>-        (MBB != DestA && MBB != DestB && !MBB->isLandingPad())) {<br>-      // This is a superfluous edge, remove it.<br>-      SI = removeSuccessor(SI);<br>-      Changed = true;<br>-    } else {<br>+    if (MBB == DestA) {<br>+      DestA = 0;<br>+      ++SI;<br>+    } else if (MBB == DestB) {<br>+      DestB = 0;<br>+      ++SI;<br>+    } else if (MBB->isLandingPad() && <br>+               MBB != OrigDestA && MBB != OrigDestB) {<br>       ++SI;<br>+    } else {<br>+      // Otherwise, this is a superfluous edge, remove it.<br>+      SI = removeSuccessor(SI);<br>+      MadeChange = true;<br>     }<br>   }<br><br>-  return Changed;<br>+  if (!AddedFallThrough)<br>+    assert(DestA == 0 && DestB == 0 && "MachineCFG is missing edges!");<br>+  else if (isCond)<br>+    assert(DestA == 0 && "MachineCFG is missing edges!");<br>+<br>+  return MadeChange;<br> }<br><br> /// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></div></blockquote></div><br></div></body></html>