llvm::createUnreachableBlockEliminationPass

Create a pass that deletes unreachable IR basic blocks.

Synopsis

Declared in <llvm/CodeGen/Passes.h>

FunctionPass*
createUnreachableBlockEliminationPass();

Description

The LLVM code generator does not work well with unreachable basic blocks (what live ranges make sense for a block that cannot be reached?). As such, a code generator should either not instruction select unreachable blocks, or run this pass as its last LLVM modifying pass to clean up blocks that are not reachable from the entry block.

Return Value

The newly created FunctionPass.