MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / dce

Function dce

crates/rustc_codegen_spirv/src/linker/dce.rs:14–18  ·  view source on GitHub ↗
(module: &mut Module)

Source from the content-addressed store, hash-verified

12use rustc_data_structures::fx::FxIndexSet;
13
14pub fn dce(module: &mut Module) {
15 let mut rooted = collect_roots(module);
16 while spread_roots(module, &mut rooted) {}
17 kill_unrooted(module, &rooted);
18}
19
20pub fn collect_roots(module: &Module) -> FxIndexSet<Word> {
21 let mut rooted = FxIndexSet::default();

Callers 1

linkFunction · 0.85

Calls 3

collect_rootsFunction · 0.85
spread_rootsFunction · 0.85
kill_unrootedFunction · 0.85

Tested by

no test coverage detected