Compile the function, Run the function through all the passes necessary to generate code for the target ISA represented by `isa`. The generated machine code is not relocated. Instead, any relocations can be obtained from `compiled_code.buffer.relocs()`. Performs any optimizations that are enabled, unless `optimize()` was already invoked. Returns the generated machine code as well as information
(
&mut self,
isa: &dyn TargetIsa,
ctrl_plane: &mut ControlPlane,
)
| 209 | /// Returns the generated machine code as well as information about |
| 210 | /// the function's code and read-only data. |
| 211 | pub fn compile( |
| 212 | &mut self, |
| 213 | isa: &dyn TargetIsa, |
| 214 | ctrl_plane: &mut ControlPlane, |
| 215 | ) -> CompileResult<'_, &CompiledCode> { |
| 216 | let stencil = self |
| 217 | .compile_stencil(isa, ctrl_plane) |
| 218 | .map_err(|error| CompileError { |
| 219 | inner: error, |
| 220 | func: &self.func, |
| 221 | })?; |
| 222 | Ok(self |
| 223 | .compiled_code |
| 224 | .insert(stencil.apply_params(&self.func.params))) |
| 225 | } |
| 226 | |
| 227 | /// If available, return information about the code layout in the |
| 228 | /// final machine code: the offsets (in bytes) of each basic-block |