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

Method new

cranelift/codegen/src/egraph/elaborate.rs:141–169  ·  view source on GitHub ↗
(
        func: &'a mut Function,
        domtree: &'a DominatorTree,
        loop_analysis: &'a LoopAnalysis,
        remat_values: &'a FxHashSet<Value>,
        stats: &'a mut Stats,
        ctrl_pl

Source from the content-addressed store, hash-verified

139
140impl<'a> Elaborator<'a> {
141 pub(crate) fn new(
142 func: &'a mut Function,
143 domtree: &'a DominatorTree,
144 loop_analysis: &'a LoopAnalysis,
145 remat_values: &'a FxHashSet<Value>,
146 stats: &'a mut Stats,
147 ctrl_plane: &'a mut ControlPlane,
148 ) -> Self {
149 let num_values = func.dfg.num_values();
150 let mut value_to_best_value =
151 SecondaryMap::with_default(BestEntry(Cost::infinity(), Value::reserved_value()));
152 value_to_best_value.resize(num_values);
153 Self {
154 func,
155 domtree,
156 loop_analysis,
157 value_to_elaborated_value: ScopedHashMap::with_capacity(num_values),
158 value_to_best_value,
159 loop_stack: smallvec![],
160 cur_block: Block::reserved_value(),
161 remat_values,
162 elab_stack: vec![],
163 elab_result_stack: vec![],
164 block_stack: vec![],
165 remat_copies: FxHashMap::default(),
166 stats,
167 ctrl_plane,
168 }
169 }
170
171 fn start_block(&mut self, idom: Option<Block>, block: Block) {
172 trace!(

Callers

nothing calls this directly

Calls 3

BestEntryClass · 0.85
num_valuesMethod · 0.80
resizeMethod · 0.45

Tested by

no test coverage detected