put register classes into arch_env struct, no need for complicated callbacks
[libfirm] / ir / be / beflags.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       modifies schedule so flags dependencies are respected.
23  * @author      Matthias Braun, Christoph Mallon
24  * @version     $Id: besched.h 14693 2007-06-21 15:35:49Z beck $
25  */
26 #ifndef FIRM_BE_BEFLAGS_H
27 #define FIRM_BE_BEFLAGS_H
28
29 #include "bearch.h"
30 #include "beirg.h"
31
32 /**
33  * Callback which rematerializes (=duplicates) a machine node.
34  */
35 typedef ir_node * (*func_rematerialize) (ir_node *node, ir_node *after);
36
37 /**
38  * Callback function that checks wether a node modifies the flags
39  */
40 typedef bool (*check_modifies_flags) (const ir_node *node);
41
42 /**
43  * Walks the schedule and ensures that flags aren't destroyed between producer
44  * and consumer of flags. It does so by moving down/rematerialising of the
45  * nodes. This does not work across blocks.
46  * The callback functions may be NULL if you want to use default
47  * implementations.
48  */
49 void be_sched_fix_flags(ir_graph *irg, const arch_register_class_t *flag_cls,
50                         func_rematerialize remat_func,
51                         check_modifies_flags check_modifies_flags_func);
52
53 #endif