llvm::DeleteDeadPHIs

Examine each PHI in the given block and delete it if it is dead. Also recursively delete any operands that become dead as a result. This includes tracing the def-use list from the PHI to see if it is ultimately unused or if it reaches an unused cycle. Return true if any PHIs were deleted.

Synopsis

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

bool
DeleteDeadPHIs(
    BasicBlock* BB,
    TargetLibraryInfo const* TLI = nullptr,
    MemorySSAUpdater* MSSAU = nullptr,
    SmallPtrSetImpl<PHINode*>* KnownNonDeadPHIs = nullptr);

Parameters

NameDescription
BBLLVM Basic Block Representation
TLIProvides information about what library functions are available for the current target.
KnownNonDeadPHIsA templated base class for SmallPtrSet which provides the typesafe interface that is common across all small sizes.