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

Method value_def

cranelift/codegen/src/ir/dfg.rs:401–412  ·  view source on GitHub ↗

Get the definition of a value. This is either the instruction that defined it or the Block that has the value as an parameter.

(&self, v: Value)

Source from the content-addressed store, hash-verified

399 /// This is either the instruction that defined it or the Block that has the value as an
400 /// parameter.
401 pub fn value_def(&self, v: Value) -> ValueDef {
402 match ValueData::from(self.values[v]) {
403 ValueData::Inst { inst, num, .. } => ValueDef::Result(inst, num as usize),
404 ValueData::Param { block, num, .. } => ValueDef::Param(block, num as usize),
405 ValueData::Alias { original, .. } => {
406 // Make sure we only recurse one level. `resolve_aliases` has safeguards to
407 // detect alias loops without overrunning the stack.
408 self.value_def(self.resolve_aliases(original))
409 }
410 ValueData::Union { x, y, .. } => ValueDef::Union(x, y),
411 }
412 }
413
414 /// Determine if `v` is an attached instruction result / block parameter.
415 ///

Callers 15

mutateMethod · 0.80
harvest_candidate_lhsFunction · 0.80
post_order_dfsFunction · 0.80
type_suffixFunction · 0.80
write_operandsFunction · 0.80
nextMethod · 0.80
unreachable_nodeFunction · 0.80
insts_same_blockFunction · 0.80
compute_use_statesFunction · 0.80
put_value_in_regsMethod · 0.80
values_and_defsMethod · 0.80

Calls 5

fromFunction · 0.85
ResultClass · 0.85
ParamClass · 0.85
resolve_aliasesMethod · 0.80
UnionClass · 0.50

Tested by 5

unreachable_nodeFunction · 0.64
insts_same_blockFunction · 0.64
aliasesFunction · 0.64
unreachable_nodeFunction · 0.64
insts_same_blockFunction · 0.64