Run optimizations via the egraph infrastructure.
(
&mut self,
fisa: FOI,
ctrl_plane: &mut ControlPlane,
)
| 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 | } |
no test coverage detected