1 /* run-rtl-passes.c - Run RTL passes directly from frontend
2 Copyright (C) 2016-2017 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
22 #include "coretypes.h"
26 #include "basic-block.h"
27 #include "tree-pass.h"
29 #include "pass_manager.h"
33 #include "insn-attr-common.h" /* for INSN_SCHEDULING. */
34 #include "insn-attr.h" /* for init_sched_attrs. */
35 #include "run-rtl-passes.h"
37 /* Run the backend passes, starting at the given pass.
38 Take ownership of INITIAL_PASS_NAME. */
41 run_rtl_passes (char *initial_pass_name
)
43 cfun
->pass_startwith
= initial_pass_name
;
44 max_regno
= max_reg_num ();
46 /* Pass "expand" normally sets this up. */
47 #ifdef INSN_SCHEDULING
51 bitmap_obstack_initialize (NULL
);
52 bitmap_obstack_initialize (®_obstack
);
54 opt_pass
*rest_of_compilation
55 = g
->get_passes ()->get_rest_of_compilation ();
56 gcc_assert (rest_of_compilation
);
57 execute_pass_list (cfun
, rest_of_compilation
);
59 opt_pass
*clean_slate
= g
->get_passes ()->get_clean_slate ();
60 gcc_assert (clean_slate
);
61 execute_pass_list (cfun
, clean_slate
);
63 bitmap_obstack_release (®_obstack
);
65 cfun
->curr_properties
|= PROP_rtl
;