499fb11527305df7795ee54ba8daf1e891df7432
[libfirm] / ir / be / benode_t.h
1 /**
2  * @file   benode_t.h
3  * @date   17.05.2005
4  * @author Sebastian Hack
5  *
6  * Backend node support.
7  *
8  * Copyright (C) 2005 Universitaet Karlsruhe
9  * Released under the GPL
10  */
11
12 #ifndef _BENODE_T_H
13 #define _BENODE_T_H
14
15 #include "pmap.h"
16
17 #include "irmode.h"
18 #include "irnode.h"
19
20 #include "bearch.h"
21
22 struct _be_node_factory_t {
23   const arch_isa_if_t *isa;
24
25   struct obstack      obst;
26   set                 *ops;
27   pmap                *irn_op_map;
28   pmap                *reg_req_map;
29
30   arch_irn_handler_t  handler;
31   arch_irn_ops_t      irn_ops;
32 };
33
34 typedef struct _be_node_factory_t                       be_node_factory_t;
35
36 be_node_factory_t *be_node_factory_init(be_node_factory_t *factory,
37     const arch_isa_if_t *isa);
38
39 const arch_irn_handler_t *be_node_get_irn_handler(const be_node_factory_t *f);
40
41 ir_node *new_Spill(const be_node_factory_t *factory,
42     const arch_register_class_t *cls,
43     ir_graph *irg, ir_node *bl, ir_node *node_to_spill);
44
45 ir_node *new_Reload(const be_node_factory_t *factory,
46     const arch_register_class_t *cls,
47     ir_graph *irg, ir_node *bl, ir_node *spill_node);
48
49 ir_node *new_Perm(const be_node_factory_t *factory,
50     const arch_register_class_t *cls,
51     ir_graph *irg, ir_node *bl, int arity, ir_node **in);
52
53 ir_node *new_Copy(const be_node_factory_t *factory,
54     const arch_register_class_t *cls,
55     ir_graph *irg, ir_node *block, ir_node *in);
56
57 ir_node *be_spill(const be_node_factory_t *factory, const arch_env_t *env, ir_node *irn);
58 ir_node *be_reload(const be_node_factory_t *factory, const arch_env_t *env, ir_node *irn);
59
60 int is_Spill(const be_node_factory_t *f, const ir_node *irn);
61
62 ir_node *get_Reload_Spill(ir_node *reload);
63
64 void insert_perm(const be_node_factory_t *factory,
65     const arch_register_class_t *reg_class,
66     ir_node *in_front_of);
67
68 #endif /* _BENODE_T_H */