Skip to main content

Module dce

Module dce 

Source
Expand description

Public API for dce. Dead-code elimination (DCE).

Removes instructions whose results are never used and which have no observable side effects. A single scan is enough; iterate via the PassManager for a full fixed-point.

Side-effecting instructions (Store, Call, Load, Alloca, terminators) are never removed even if their results are unused.

Structs§

DeadCodeElim
Dead-code elimination pass.

Functions§

is_dce_safe
Returns true if an unused instruction with this kind can safely be deleted.