[LLVMdev] Problem in CodeExtractor::severSplitPHINodes()

Jack Tzu-Han Hung thhung at cs.princeton.edu
Wed Nov 19 07:41:27 PST 2008


Hi,

I found a problem in CodeExtractor::severSplitPHINodes()
<CodeExtractor.cpp>.

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)
    DT->splitBlock(NewBB);

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.

Could anyone tell me how to fix this please?

Thanks a lot.

Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081119/c5323109/attachment.html>


More information about the llvm-dev mailing list