Only collect mono items from reachable blocks Fixes the wrong comment pointed out in: https://github.com/rust-lang/rust/pull/121421#discussion_r1537378431 Moves the analysis to use the worklist strategy: https://github.com/rust-lang/rust/pull/121421#discussion_r1501840823 Also fixes https://github.com/rust-lang/rust/issues/85836, using the same reachability analysis
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.