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

Method egraph_pass

cranelift/codegen/src/context.rs:365–401  ·  view source on GitHub ↗

Run optimizations via the egraph infrastructure.

(
        &mut self,
        fisa: FOI,
        ctrl_plane: &mut ControlPlane,
    )

Source from the content-addressed store, hash-verified

363
364 /// Run optimizations via the egraph infrastructure.
365 pub fn egraph_pass<'a, FOI>(
366 &mut self,
367 fisa: FOI,
368 ctrl_plane: &mut ControlPlane,
369 ) -> CodegenResult<()>
370 where
371 FOI: Into<FlagsOrIsa<'a>>,
372 {
373 let _tt = timing::egraph();
374
375 trace!(
376 "About to optimize with egraph phase:\n{}",
377 self.func.display()
378 );
379 let fisa = fisa.into();
380 self.compute_loop_analysis();
381 let mut alias_analysis = AliasAnalysis::new(&self.func, &self.domtree);
382 let mut pass = EgraphPass::new(
383 &mut self.func,
384 &self.domtree,
385 &self.loop_analysis,
386 &mut alias_analysis,
387 ctrl_plane,
388 &mut self.cfg,
389 );
390 pass.run();
391 log::debug!("egraph stats: {:?}", pass.stats);
392 trace!("After egraph optimization:\n{}", self.func.display());
393
394 // Branch optimizations can invalidate these; recompute them.
395 self.compute_cfg();
396 self.compute_domtree();
397
398 self.verify_if(fisa)?;
399
400 Ok(())
401 }
402}

Callers 1

optimizeMethod · 0.80

Calls 7

OkFunction · 0.85
compute_loop_analysisMethod · 0.80
compute_cfgMethod · 0.80
verify_ifMethod · 0.80
newFunction · 0.50
runMethod · 0.45
compute_domtreeMethod · 0.45

Tested by

no test coverage detected