Expand description
Dead-instruction elimination: removing pure instructions nothing reads.
Functions§
- dead_
insns - Returns instructions in
block_idthat 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. MirrorsContext::has_users. - host_
users - This host’s users of
v. Allocates; preferhas_usersto ask whether there are any, andusers_of_sliceto look at them in a hot loop. - remove_
dead_ insns - Removes dead pure instructions from
block_iditeratively 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.