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

Function is_rooted

crates/rustc_codegen_spirv/src/linker/dce.rs:98–108  ·  view source on GitHub ↗
(inst: &Instruction, rooted: &FxIndexSet<Word>)

Source from the content-addressed store, hash-verified

96}
97
98fn is_rooted(inst: &Instruction, rooted: &FxIndexSet<Word>) -> bool {
99 if let Some(result_id) = inst.result_id {
100 rooted.contains(&result_id)
101 } else {
102 // For things like OpDecorate which apply attributes to rooted things, but are not
103 // referenced by roots
104 inst.operands
105 .iter()
106 .any(|op| op.id_ref_any().map_or(false, |w| rooted.contains(&w)))
107 }
108}
109
110fn kill_unrooted(module: &mut Module, rooted: &FxIndexSet<Word>) {
111 module

Callers 1

kill_unrootedFunction · 0.85

Calls 1

iterMethod · 0.80

Tested by

no test coverage detected