more...
[libfirm] / ir / ana / field_temperature.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ana/field_temperature.h
4  * Purpose:     Compute an estimate of field temperature, i.e., field access heuristic.
5  * Author:      Goetz Lindenmaier
6  * Modified by:
7  * Created:     21.7.2004
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2004 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 #ifndef _FIELD_TEMPERATURE_H_
14 #define _FIELD_TEMPERATURE_H_
15
16 /**
17  * @file field_temperature.h
18  *
19  *  Watch it! This is highly java dependent.
20  *
21  * - All Sel nodes get an array with possibly accessed entities.
22  *   (resolve polymorphy on base of inherited entities.)
23  *   (the mentioned entity in first approximation.)
24  *
25  * - Each entity gets all SymConst/Sel nodes, that reference the
26  *   entity (Sel: references as accessed entity.)
27  *
28  * - We compute a value for the entity based on the Sel nodes.
29  */
30
31 #include "irnode.h"
32 #include "entity.h"
33
34
35
36 /** The entities that can be accessed by this Sel node. */
37 int     get_Sel_n_accessed_entities(ir_node *sel);
38 entity *get_Sel_accessed_entity    (ir_node *sel, int pos);
39
40
41 /** Number of Load/Store nodes that possibly access this entity. */
42 int get_entity_n_accesses(entity *ent);
43 /** Load/Store node that possibly access this entity. */
44 ir_node *get_entity_access(entity *ent, int pos);
45
46 /** Number of Alloc nodes that create an instance of this type */
47 int get_type_n_allocations(type *tp);
48 /** Alloc node that create an instance of this type */
49 ir_node *get_type_allocation(type *tp, int pos);
50
51
52 /** Get the weighted interprocedural loop depth of the node.
53     The depth is estimated by a heuristic. */
54 int get_weighted_loop_depth(ir_node *n);
55
56
57
58
59 /** compute the field temperature. */
60 void compute_field_temperature(void);
61
62 /** free occupied memory, reset */
63 void free_field_temperature(void);
64
65
66
67
68
69 /** An auxiliary/temporary function */
70 int is_jack_rts_class(type *t);
71
72 #endif /* _FIELD_TEMPERATURE_H_ */