[][src]Function falcon::analysis::dead_code_elimination

pub fn dead_code_elimination(function: &Function) -> Result<Function>

Eliminate dead code in an IL function

This pass does not eliminate variables which cross boundaries of instructions where the operation is il::Operation::Branch. This should preserve soundness, but reduces the amount of dead code eliminated.

Instructions are not removed by this analysis. Instead, they are replaced with nop operations. This preserves the location of the removed instruction, in case an analysis needs to find that instruction later.