Added phi statistics
[libfirm] / ir / be / bemain.c
1 /**
2  * Backend driver.
3  * @author Sebastian Hack
4  * @date 25.11.2004
5  */
6
7 #include "besched.h"
8 #include "belistsched.h"
9 #include "belive_t.h"
10 #include "belive.h"
11 #include "bephicongr_t.h"
12
13 #include "phistat.h"
14
15 void be_init(void)
16 {
17         be_sched_init();
18         be_liveness_init();
19         be_phi_congr_class_init();
20 }
21
22 static void be_main_loop(void)
23 {
24         int i, n;
25
26         for(i = 0, n = get_irp_n_irgs(); i < n; ++i) {
27                 ir_graph *irg = get_irp_irg(i);
28
29                 list_sched(irg, trivial_selector, NULL);
30                 be_liveness(irg);
31
32                 be_sched_dump(stdout, irg);
33                 be_liveness_dump(stdout, irg);
34         }
35 }
36
37 void be_main(int argc, const char *argv[])
38 {
39         be_main_loop();
40         /* next line only for statistics */
41         do_phi_statistics();
42 }