llvm::createPHIsForSplitLoopExit

Insert LCSSA PHI nodes required after splitting a loop exit edge.

Synopsis

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

void
createPHIsForSplitLoopExit(
    ArrayRef<BasicBlock*> Preds,
    BasicBlock* SplitBB,
    BasicBlock* DestBB);

Description

When a loop exit edge is split, LCSSA form may require new PHIs in the new exit block. This function inserts the new PHIs, as needed. Preds is a list of preds inside the loop, SplitBB is the new loop exit block, and DestBB is the old loop exit, now the successor of SplitBB.

Parameters

NameDescription
PredsPredecessors inside the loop of the split exit edge.
SplitBBNewly created loop exit block.
DestBBOriginal loop exit, now successor of SplitBB.