Add a compilation pass timing facility.
Individual compilation passes call the corresponding timing::*() function and hold on to their timing token while they run. This causes nested per-pass timing information to be recorded in thread-local storage. The --time-passes command line option prints a pass timing report to stdout.
This commit is contained in:
@@ -5,6 +5,7 @@ use flowgraph::{ControlFlowGraph, BasicBlock};
|
||||
use ir::{Ebb, Inst, Function, Layout, ProgramOrder, ExpandedProgramPoint};
|
||||
use ir::instructions::BranchInfo;
|
||||
use packed_option::PackedOption;
|
||||
use timing;
|
||||
|
||||
use std::cmp::Ordering;
|
||||
|
||||
@@ -227,6 +228,7 @@ impl DominatorTree {
|
||||
|
||||
/// Reset and compute a CFG post-order and dominator tree.
|
||||
pub fn compute(&mut self, func: &Function, cfg: &ControlFlowGraph) {
|
||||
let _tt = timing::domtree();
|
||||
debug_assert!(cfg.is_valid());
|
||||
self.compute_postorder(func);
|
||||
self.compute_domtree(func, cfg);
|
||||
|
||||
Reference in New Issue
Block a user