benode_t.h 2.55 KB
Newer Older
Sebastian Hack's avatar
Sebastian Hack committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * @file   benode_t.h
 * @date   17.05.2005
 * @author Sebastian Hack
 *
 * Backend node support.
 *
 * Copyright (C) 2005 Universitaet Karlsruhe
 * Released under the GPL
 */

#ifndef _BENODE_T_H
#define _BENODE_T_H

Sebastian Hack's avatar
Sebastian Hack committed
15
#include "firm_config.h"
16
17
#include "pmap.h"

Sebastian Hack's avatar
Sebastian Hack committed
18
19
#include "irmode.h"
#include "irnode.h"
20
#include "entity_t.h"
Sebastian Hack's avatar
Sebastian Hack committed
21

22
#include "be_t.h"
Sebastian Hack's avatar
Sebastian Hack committed
23
24
#include "bearch.h"

Sebastian Hack's avatar
Sebastian Hack committed
25
26
27
28
29
30
31
32
33
typedef enum {
	beo_NoBeOp = 0,
	beo_Spill,
	beo_Reload,
	beo_Perm,
	beo_Copy,
	beo_Keep,
	beo_Last
} be_opcode_t;
34

Sebastian Hack's avatar
Sebastian Hack committed
35
void be_node_init(void);
36

Sebastian Hack's avatar
Sebastian Hack committed
37
const arch_irn_handler_t be_node_irn_handler;
Sebastian Hack's avatar
Sebastian Hack committed
38

Sebastian Hack's avatar
Sebastian Hack committed
39
40
41
42
43
ir_node *be_new_Spill(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_node *node_to_spill, ir_node *ctx);
ir_node *be_new_Reload(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_mode *mode, ir_node *spill_node);
ir_node *be_new_Copy(const arch_register_class_t *cls, ir_graph *irg, ir_node *block, ir_node *in);
ir_node *be_new_Perm(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
ir_node *be_new_Keep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, int arity, ir_node *in[]);
Sebastian Hack's avatar
Sebastian Hack committed
44

Sebastian Hack's avatar
Sebastian Hack committed
45
46
ir_node *be_spill(const arch_env_t *arch_env, ir_node *irn,ir_node *spill_ctx);
ir_node *be_reload(const arch_env_t *arch_env, const arch_register_class_t *cls, ir_node *irn, int pos, ir_mode *mode, ir_node *spill);
Sebastian Hack's avatar
Sebastian Hack committed
47

48
49
50
51
int be_is_Spill(const ir_node *irn);
int be_is_Reload(const ir_node *irn);
int be_is_Copy(const ir_node *irn);
int be_is_Perm(const ir_node *irn);
Sebastian Hack's avatar
Sebastian Hack committed
52
int be_is_Keep(const ir_node *irn);
Sebastian Hack's avatar
Sebastian Hack committed
53

54
55
void   be_set_Spill_entity(ir_node *irn, entity *ent);
entity *be_get_spill_entity(ir_node *irn);
56

Sebastian Hack's avatar
Sebastian Hack committed
57
ir_node *be_get_Spill_context(const ir_node *irn);
58
59


60
61
62
63
64
/**
 * Modify the output register requirements of a Perm.
 * This function incur register constraints to an output value of a Perm.
 * This is used when handling register constraints in general,
 * see beconstrperm.c
Sebastian Hack's avatar
Sebastian Hack committed
65
66
67
68
 * @param irn The perm node.
 * @param pos The position.
 * @param req The requirements to set to.
 * @param negate_limited When the requirements are limited, inverse the set of admissible registers.
69
 */
Sebastian Hack's avatar
Sebastian Hack committed
70
void be_set_Perm_out_req(ir_node *irn, int pos, const arch_register_req_t *req, unsigned negate_limited);
71
72
73
74
75
76
77

/**
 * Insert a Perm node after a specific node in the schedule.
 * The Perm permutes over all values live at the given node.
 * This means that all liveness intervals are cut apart at this
 * location in the program.
 */
Sebastian Hack's avatar
Sebastian Hack committed
78
ir_node *insert_Perm_after(const arch_env_t *env,
Sebastian Hack's avatar
Sebastian Hack committed
79
80
81
						   const arch_register_class_t *cls,
						   dom_front_info_t *dom_front,
						   ir_node *pos);
Sebastian Hack's avatar
Sebastian Hack committed
82

Sebastian Hack's avatar
Sebastian Hack committed
83
#endif /* _BENODE_T_H */