Ensures LCSSA form for every instruction from the Worklist in the scope of innermost containing loop.

Synopsis

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

bool
formLCSSAForInstructions(
    SmallVectorImpl<Instruction*>& Worklist,
    DominatorTree const& DT,
    LoopInfo const& LI,
    ScalarEvolution* SE,
    SmallVectorImpl<PHINode*>* PHIsToRemove = nullptr,
    SmallVectorImpl<PHINode*>* InsertedPHIs = nullptr);

Description

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 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.

If InsertedPHIs is not nullptr, inserted phis will be added to this vector.

Parameters

Name

Description

Worklist

This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.

DT

Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.

SE

The main scalar evolution driver. Because client code (intentionally) can't do much with the SCEV objects directly, they must ask this class for services.

PHIsToRemove

This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.

InsertedPHIs

This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter.

Created with MrDocs