llvm::MergeBasicBlockIntoOnlyPred

Merge a block into its unique predecessor when that edge is trivial.

Synopsis

Declared in <llvm/Transforms/Utils/Local.h>

void
MergeBasicBlockIntoOnlyPred(
    BasicBlock* BB,
    DomTreeUpdater* DTU = nullptr);

Description

BB is a block with one predecessor and its predecessor is known to have one successor (BB!). Eliminate the edge between them, moving the instructions in the predecessor into BB. This deletes the predecessor block.

Parameters

NameDescription
BBBlock to absorb its unique predecessor into.
DTUOptional dominator-tree updater for CFG changes.