- BugFix: ensure that Convs are created in the right block
[libfirm] / ir / be / beinfo.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       additional backend node infos
23  * @author      Matthias Braun
24  * @version     $Id$
25  */
26 #ifndef FIRM_BE_BEINFO_H
27 #define FIRM_BE_BEINFO_H
28
29 #include "bearch.h"
30 #include "irphase_t.h"
31 #include "irphases_t.h"
32
33 typedef unsigned int sched_timestep_t;
34
35 /**
36  * The schedule structure which is present at each ir node.
37  *
38  * Currently, only basic blocks are scheduled. The list head of
39  * every block schedule list is the Block list.
40  */
41 typedef struct sched_info_t {
42         struct list_head list;         /**< The list head to list the nodes in a schedule. */
43         unsigned idx;                  /**< The node index of the nodes this schedule info belongs to. */
44         sched_timestep_t time_step;    /**< If a is after b in a schedule, its time step is larger than b's. */
45         unsigned scheduled : 1;        /**< 1, if the node is in the schedule of the block, 0 else. */
46 } sched_info_t;
47
48 typedef struct reg_out_info_t {
49         const arch_register_t     *reg;
50         const arch_register_req_t *req;
51 } reg_out_info_t;
52
53 typedef struct backend_info_t {
54         sched_info_t                sched_info;
55         const arch_register_req_t **in_reqs;
56         reg_out_info_t             *out_infos;
57         arch_irn_flags_t            flags;
58 } backend_info_t;
59
60 static inline backend_info_t *be_get_info(const ir_node *node)
61 {
62         backend_info_t *info = node->backend_info;
63         return info;
64 }
65
66 void be_info_init(void);
67 void be_info_free(void);
68 void be_info_init_irg(ir_graph *irg);
69 void be_info_new_node(ir_node *node);
70 void be_info_duplicate(const ir_node *old_node, ir_node *new_node);
71 int be_info_initialized(const ir_graph *irg);
72
73 int be_info_equal(const ir_node *node1, const ir_node *node2);
74
75 #endif