Split PredBB‐>BB and duplicate non‐Phi instructions into the split block.

Synopsis

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

BasicBlock*
DuplicateInstructionsInSplitBetween(
    BasicBlock* BB,
    BasicBlock* PredBB,
    Instruction* StopAt,
    ValueToValueMapTy& ValueMapping,
    DomTreeUpdater& DTU);

Description

Split edge between BB and PredBB and duplicate all non‐Phi instructions from BB between its beginning and the StopAt instruction into the split block. Phi nodes are not duplicated, but their uses are handled correctly: we replace them with the uses of corresponding Phi inputs. ValueMapping is used to map the original instructions from BB to their newly‐created copies.

Return Value

The newly created split block.

Parameters

Name

Description

BB

Destination block whose early instructions are duplicated.

PredBB

Predecessor connected to BB by the edge being split.

StopAt

First instruction of BB not to duplicate into the split block.

ValueMapping

Mapping from original instructions in BB to their copies in the split block.

DTU

Dominator‐tree updater notified about the CFG change.

Created with MrDocs