Run the legalizer for `isa` on the function.
(&mut self, isa: &dyn TargetIsa)
| 295 | |
| 296 | /// Run the legalizer for `isa` on the function. |
| 297 | pub fn legalize(&mut self, isa: &dyn TargetIsa) -> CodegenResult<()> { |
| 298 | // Legalization invalidates the domtree and loop_analysis by mutating the CFG. |
| 299 | // TODO: Avoid doing this when legalization doesn't actually mutate the CFG. |
| 300 | self.domtree.clear(); |
| 301 | self.loop_analysis.clear(); |
| 302 | self.cfg.clear(); |
| 303 | |
| 304 | // Run some specific legalizations only. |
| 305 | simple_legalize(&mut self.func, isa); |
| 306 | self.verify_if(isa) |
| 307 | } |
| 308 | |
| 309 | /// Compute the control flow graph. |
| 310 | pub fn compute_cfg(&mut self) { |