ΒΆbool formLCSSAForInstructions(
    SmallVectorImpl<llvm::Instruction*>& Worklist,
    const llvm::DominatorTree& DT,
    const llvm::LoopInfo& LI,
    llvm::ScalarEvolution* SE,
    llvm::IRBuilderBase& Builder,
    SmallVectorImpl<llvm::PHINode*>*
        PHIsToRemove = nullptr)

Description

Ensures LCSSA form for every instruction from the Worklist in the scope of innermost containing loop. For the given instruction which have uses outside of the loop, an LCSSA PHI node is inserted and the uses outside the loop are rewritten to use this node. LoopInfo and DominatorTree are required and, since the routine makes no changes to CFG, preserved. Returns true if any modifications are made. This function may introduce unused PHI nodes. If \p PHIsToRemove is not nullptr, those are added to it (before removing, the caller has to check if they still do not have any uses). Otherwise the PHIs are directly removed.

Declared at: llvm/include/llvm/Transforms/Utils/LoopUtils.h:80

Parameters

SmallVectorImpl<llvm::Instruction*>& Worklist
const llvm::DominatorTree& DT
const llvm::LoopInfo& LI
llvm::ScalarEvolution* SE
llvm::IRBuilderBase& Builder
SmallVectorImpl<llvm::PHINode*>* PHIsToRemove = nullptr