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:
@@ -4,6 +4,7 @@ use cursor::{Cursor, FuncCursor};
|
||||
use dominator_tree::DominatorTree;
|
||||
use flowgraph::ControlFlowGraph;
|
||||
use ir;
|
||||
use timing;
|
||||
|
||||
/// Eliminate unreachable code.
|
||||
///
|
||||
@@ -16,6 +17,7 @@ pub fn eliminate_unreachable_code(
|
||||
cfg: &mut ControlFlowGraph,
|
||||
domtree: &DominatorTree,
|
||||
) {
|
||||
let _tt = timing::unreachable_code();
|
||||
let mut pos = FuncCursor::new(func);
|
||||
while let Some(ebb) = pos.next_ebb() {
|
||||
if domtree.is_reachable(ebb) {
|
||||
|
||||
Reference in New Issue
Block a user