llvm::RecursivelyDeleteTriviallyDeadInstructions

Recursively delete a worklist of trivially dead instructions.

Synopsis

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

void
RecursivelyDeleteTriviallyDeadInstructions(
    SmallVectorImpl<WeakTrackingVH>& DeadInsts,
    TargetLibraryInfo const* TLI = nullptr,
    MemorySSAUpdater* MSSAU = nullptr,
    std::function<void(Value*)> AboutToDeleteCallback = std::function<void(Value *)>());

Description

Delete all of the instructions in DeadInsts, and all other instructions that deleting these in turn causes to be trivially dead.

The initial instructions in the provided vector must all have empty use lists and satisfy isInstructionTriviallyDead.

DeadInsts will be used as scratch storage for this routine and will be empty afterward.

Parameters

NameDescription
DeadInstsWorklist of trivially dead instructions to delete.
TLIOptional target library info used for deadness analysis.
MSSAUOptional MemorySSA updater notified of deletions.
AboutToDeleteCallbackOptional callback invoked before each deletion.