This little patch adds the SortByWallClock() function to the TimerGroup class. You can use this function to suppress the usual sorting of the timer reports in wall clock order. I find that order confusing, since the timers move around in the report depending on their percentage of the total wall clock time. Without the sort, the timers appear in the order they were created, which is good for timing sequential phases.
I added one more timer to DAGISelEmitter so I could do a thorough test. The unsorted report looks like:
===-------------------------------------------------------------------------=== TableGen Phase Timing ===-------------------------------------------------------------------------=== Total Execution Time: 128.5448 seconds (128.6254 wall clock) ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- 15.3505 ( 12.0%) 0.0156 ( 14.3%) 15.3661 ( 12.0%) 15.3869 ( 12.0%) Parse, build records 37.8926 ( 29.5%) 0.0468 ( 42.9%) 37.9394 ( 29.5%) 37.9292 ( 29.5%) Parse patterns 2.2464 ( 1.7%) 0.0000 ( 0.0%) 2.2464 ( 1.7%) 2.2571 ( 1.8%) Sort patterns 68.9056 ( 53.6%) 0.0312 ( 28.6%) 68.9368 ( 53.6%) 68.9859 ( 53.6%) Convert to matchers 1.0764 ( 0.8%) 0.0000 ( 0.0%) 1.0764 ( 0.8%) 1.0841 ( 0.8%) Optimize matchers 2.9640 ( 2.3%) 0.0156 ( 14.3%) 2.9796 ( 2.3%) 2.9772 ( 2.3%) Emit matcher table 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0050 ( 0.0%) Write output 128.4356 (100.0%) 0.1092 (100.0%) 128.5448 (100.0%) 128.6254 (100.0%) Total