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

Name

Description

DeadInsts

Worklist of trivially dead instructions to delete.

TLI

Optional target library info used for deadness analysis.

MSSAU

Optional MemorySSA updater notified of deletions.

AboutToDeleteCallback

Optional callback invoked before each deletion.

Created with MrDocs