Skip to main content

Module dce

Module dce 

Source
Expand description

Dead-instruction elimination: removing pure instructions nothing reads.

Functions§

dead_insns
Returns instructions in block_id that are pure and have no live users: no users at all, or none that this same answer does not already condemn.
has_users
Whether this host records any user of v. A shared value with no owning function has none. Mirrors Context::has_users.
host_users
This host’s users of v. Allocates; prefer has_users to ask whether there are any, and users_of_slice to look at them in a hot loop.
remove_dead_insns
Removes dead pure instructions from block_id iteratively until fixed point, updating the users reverse map after each round.
remove_dead_insns_body
Body-local core of remove_dead_insns.
remove_unused_no_pred_block_params
Removes block params that have no users when the block has no incoming control-flow edges. This covers function-entry params introduced for load-before-store registers that later become dead, without touching join blocks whose predecessor terminators carry positional arguments.