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

Method legalize

cranelift/codegen/src/context.rs:297–307  ·  view source on GitHub ↗

Run the legalizer for `isa` on the function.

(&mut self, isa: &dyn TargetIsa)

Source from the content-addressed store, hash-verified

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) {

Callers 5

runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
optimizeMethod · 0.80
compile_functionMethod · 0.80

Calls 3

simple_legalizeFunction · 0.85
verify_ifMethod · 0.80
clearMethod · 0.45

Tested by 3

runMethod · 0.64
runMethod · 0.64
runMethod · 0.64