<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 19, 2008, at 7:41 AM, Jack Tzu-Han Hung wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>I found a problem in CodeExtractor::severSplitPHINodes() <CodeExtractor.cpp>.<br><br>The algorithm first separates the header block into two, one containing only PHI nodes and the other containing the remaining non-PHI nodes. The variable NewBB holds the pointer to the latter half block. Later, it tries to update DT information.<br> <br>if (DT)<br>    DT->splitBlock(NewBB);<br><br>In splitBlock, it checks if the NewBB has only one successor. I'm not sure why this is required, but it will fail on cases where NewBB has multiple successors, which are pretty common. For example, a switch or a conditional branch in NewBB can break this check.</blockquote><div><br></div>DT->splitBlock() updates dominator information _after_ the block is split. The comments in header says,</div><div><br></div><div><div>  /// splitBlock - BB is split and now it has one successor. Update dominance                                                                                                                                </div><div>  /// frontier to reflect this change.                                                                                                                                                                       </div><div>  void splitBlock(BasicBlock *BB);</div><div><br></div><div>Immediately after the split the NewBB can have only one successor.</div><div><br></div><blockquote type="cite"><br> <br>Could anyone tell me how to fix this please?<br><br>Thanks a lot.<br><br>Jack<br><br> _______________________________________________<br>LLVM Developers mailing list<br>LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>-</div><div>Devang</div><div><br></div></div></span><br class="Apple-interchange-newline"> </div><br></body></html>