[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()
dpatel at apple.com
Wed Nov 19 16:41:24 PST 2008
On Nov 19, 2008, at 7:41 AM, Jack Tzu-Han Hung wrote:
> I found a problem in CodeExtractor::severSplitPHINodes()
> 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.
> if (DT)
> 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.
DT->splitBlock() updates dominator information _after_ the block is
split. The comments in header says,
/// splitBlock - BB is split and now it has one successor. Update
/// frontier to reflect this change.
void splitBlock(BasicBlock *BB);
Immediately after the split the NewBB can have only one successor.
> Could anyone tell me how to fix this please?
> Thanks a lot.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev