Support plugging external profilers into the Cranelift timing infrastructure (#5749)
* Remove no-std code for cranelift_codegen::timings no-std mode isn't supported by Cranelift anymore * Simplify define_passes macro * Add egraph opt timings * Replace the add_to_current api with PassTimes::add * Omit a couple of unused time measurements * Reduce divergence between run and run_passes a bit * Introduce a Profiler trait This allows plugging in external profilers into the Cranelift profiling framework. * Add Pass::description method * Remove duplicate usage of the compile pass timing * Rustfmt
This commit is contained in:
@@ -213,7 +213,6 @@ impl Context {
|
||||
///
|
||||
/// Returns information about the function's code and read-only data.
|
||||
pub fn compile(&mut self, isa: &dyn TargetIsa) -> CompileResult<&CompiledCode> {
|
||||
let _tt = timing::compile();
|
||||
let stencil = self.compile_stencil(isa).map_err(|error| CompileError {
|
||||
inner: error,
|
||||
func: &self.func,
|
||||
@@ -379,6 +378,8 @@ impl Context {
|
||||
|
||||
/// Run optimizations via the egraph infrastructure.
|
||||
pub fn egraph_pass(&mut self) -> CodegenResult<()> {
|
||||
let _tt = timing::egraph();
|
||||
|
||||
trace!(
|
||||
"About to optimize with egraph phase:\n{}",
|
||||
self.func.display()
|
||||
|
||||
Reference in New Issue
Block a user