ΒΆbool MergeBlockIntoPredecessor(
    llvm::BasicBlock* BB,
    llvm::DomTreeUpdater* DTU = nullptr,
    llvm::LoopInfo* LI = nullptr,
    llvm::MemorySSAUpdater* MSSAU = nullptr,
    llvm::MemoryDependenceResults* MemDep =
        nullptr,
    bool PredecessorWithTwoSuccessors = false)

Description

Attempts to merge a block into its predecessor, if possible. The return value indicates success or failure. By default do not merge blocks if BB's predecessor has multiple successors. If PredecessorWithTwoSuccessors = true, the blocks can only be merged if BB's Pred has a branch to BB and to AnotherBB, and BB has a single successor Sing. In this case the branch will be updated with Sing instead of BB, and BB will still be merged into its predecessor and removed.

Declared at: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:91

Parameters

llvm::BasicBlock* BB
llvm::DomTreeUpdater* DTU = nullptr
llvm::LoopInfo* LI = nullptr
llvm::MemorySSAUpdater* MSSAU = nullptr
llvm::MemoryDependenceResults* MemDep = nullptr
bool PredecessorWithTwoSuccessors = false