llvm::RecursivelyDeleteTriviallyDeadInstructions

Recursively delete a trivially dead instruction and its dead operands.

Synopsis

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

bool
RecursivelyDeleteTriviallyDeadInstructions(
    Value* V,
    TargetLibraryInfo const* TLI = nullptr,
    MemorySSAUpdater* MSSAU = nullptr,
    std::function<void(Value*)> AboutToDeleteCallback = std::function<void(Value *)>());

Description

If the specified value is a trivially dead instruction, delete it. If that makes any of its operands trivially dead, delete them too, recursively. Return true if any instructions were deleted.

Return Value

True if any instructions were deleted.

Parameters

NameDescription
VValue that may be a trivially dead instruction.
TLIOptional target library info used for deadness analysis.
MSSAUOptional MemorySSA updater notified of deletions.
AboutToDeleteCallbackOptional callback invoked before each deletion.