ΒΆllvm::BasicBlock* SplitCriticalEdge(
    llvm::Instruction* TI,
    unsigned int SuccNum,
    const llvm::CriticalEdgeSplittingOptions&
        Options =
            llvm::CriticalEdgeSplittingOptions(),
    const llvm::Twine& BBName = "")

Description

If this edge is a critical edge, insert a new node to split the critical edge. This will update the analyses passed in through the option struct. This returns the new block if the edge was split, null otherwise. If MergeIdenticalEdges in the options struct is true (not the default), *all* edges from TI to the specified successor will be merged into the same critical edge block. This is most commonly interesting with switch instructions, which may have many edges to any one destination. This ensures that all edges to that dest go to one block instead of each going to a different block, but isn't the standard definition of a "critical edge". It is invalid to call this function on a critical edge that starts at an IndirectBrInst. Splitting these edges will almost always create an invalid program because the address of the new block won't be the one that is jumped to.

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

Parameters

llvm::Instruction* TI
unsigned int SuccNum
const llvm::CriticalEdgeSplittingOptions& Options = llvm::CriticalEdgeSplittingOptions()
const llvm::Twine& BBName = ""