MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / block_dominates

Method block_dominates

cranelift/codegen/src/dominator_tree/simple.rs:153–167  ·  view source on GitHub ↗

Returns `true` if `block_a` dominates `block_b`. A block is considered to dominate itself.

(&self, block_a: Block, mut block_b: Block)

Source from the content-addressed store, hash-verified

151 ///
152 /// A block is considered to dominate itself.
153 fn block_dominates(&self, block_a: Block, mut block_b: Block) -> bool {
154 let rpo_a = self.nodes[block_a].rpo_number;
155
156 // Run a finger up the dominator tree from b until we see a.
157 // Do nothing if b is unreachable.
158 while rpo_a < self.nodes[block_b].rpo_number {
159 let idom = match self.idom(block_b) {
160 Some(idom) => idom,
161 None => return false, // a is unreachable, so we climbed past the entry
162 };
163 block_b = idom;
164 }
165
166 block_a == block_b
167 }
168
169 /// Compute the common dominator of two basic blocks.
170 ///

Callers 4

dominatesMethod · 0.45
get_available_blockMethod · 0.45
merge_availabilityMethod · 0.45
verify_inst_argMethod · 0.45

Calls 1

idomMethod · 0.45

Tested by

no test coverage detected