llvm::RecursivelyDeleteDeadPHINode

Recursively delete an effectively dead PHI and its dead operands.

Synopsis

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

bool
RecursivelyDeleteDeadPHINode(
    PHINode* PN,
    TargetLibraryInfo const* TLI = nullptr,
    MemorySSAUpdater* MSSAU = nullptr,
    SmallPtrSetImpl<PHINode*>* KnownNonDeadPHIs = nullptr);

Description

If the specified value is an effectively dead PHI node, due to being a def-use chain of single-use nodes that either forms a cycle or is terminated by a trivially dead instruction, delete it. If that makes any of its operands trivially dead, delete them too, recursively. Return true if a change was made.

Return Value

True if a change was made.

Parameters

NameDescription
PNPHI node that may be effectively dead.
TLIOptional target library info used for deadness analysis.
MSSAUOptional MemorySSA updater notified of deletions.
KnownNonDeadPHIsOptional set of PHIs known not to be dead.