[LLVMdev] Erasing dead blocks

Gordon Haak gordon.haak at googlemail.com
Mon Jan 3 04:04:41 PST 2011


Dear LLVM developers,

I have a question regarding the IPSCCP class and the handling of dead blocks:

The file lib/Transforms/Scalar/SCCP.cpp of llvm 2.8 from contains some
code to deal with a dead block which could not be folded (line
1909ff). This happens when a user of this dead block is a branch or
switch with an undef condition. The action taken than is to replace
this terminator with an unconditional branch to the first successor of
this undef branch/switch.
I do not see how this ensures that the dead block is disconnected from
the control flow graph. If the dead block is the first successor of
the switch resp. branch the dead block will be still reachable after
this code. Am I wrong here? Is there somewhere else code ensuring that
the dead block is not the first successor of an undef branch/switch
instruction?
Thanks for your support.

Kind regards,
Gordon Haak



More information about the llvm-dev mailing list