Thank you, Cameron.<br>I also think Dominator::splitBasicBlock() is kind of OK, except the assertion at line 232 (Dominator.h)<br>That assertion fails when we split the entry basic block (obviously, it does not have any dominator).<br>
<br>What I asked for was the use of splitBasicBlock in CodeExtractor.cpp, line 145.<br>Vu<br><br><div class="gmail_quote">On Mon, Jan 3, 2011 at 3:25 PM, Cameron Zwarich <span dir="ltr"><<a href="mailto:zwarich@apple.com">zwarich@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">On Dec 31, 2010, at 11:20 AM, Vu Le wrote:<br>
<br>
> There might be a misuse of DominatorTree::splitBasicBlock in CodeExtractor.cpp, line 145.<br>
> Header is splited into two (OldPred->NewBB).<br>
><br>
> Line 145 updates the dominator tree by calling DT->splitBasicBlock(NewBB).<br>
> I think it should be DT->splitBasicBlock(OldPred).<br>
><br>
> When I tried to extract a code region whose header has 2 successors, my pass crashed.<br>
> It was because header (or OldPred) is the block that was splited, not NewBB.<br>
> DominatorTree::splitBasicBlock(BB) requires BB to have one successor.<br>
<br>
<br>
</div></div>The code in Dominator::splitBasicBlock() looks correct, but I think the comment and assert may not be. I was writing a patch where I hit the same issue.<br>
<font color="#888888"><br>
Cameron</font></blockquote></div><br>