becopyopt: Remove the unnecessary attribute name from struct copy_opt_t.
[libfirm] / ir / be / beuses.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief       Methods to compute when a value will be used again.
9  * @author      Sebastian Hack, Matthias Braun
10  * @date        27.06.2005
11  */
12 #ifndef FIRM_BE_BEUSES_H
13 #define FIRM_BE_BEUSES_H
14
15 #include "firm_types.h"
16 #include "belive.h"
17
18 /**
19  * Describes a use of a value.
20  */
21 typedef struct be_next_use_t {
22         unsigned       time;
23         unsigned       outermost_loop;
24         /* point of the next use is at the beginning of this node. */
25         const ir_node *before;
26 } be_next_use_t;
27
28 #define USES_INFINITY  10000000
29 #define USES_PENDING   9999999
30
31 static inline bool USES_IS_INFINITE(unsigned time)
32 {
33         return time >= USES_INFINITY;
34 }
35
36 static inline bool USES_IS_PENDING(unsigned time)
37 {
38         return time == USES_PENDING;
39 }
40
41 typedef struct be_uses_t be_uses_t;
42
43 be_next_use_t be_get_next_use(be_uses_t *uses, ir_node *from,
44                               const ir_node *def, int skip_from_uses);
45
46 /**
47  * Creates a new uses environment for a graph.
48  *
49  * @param irg  the graph
50  * @param lv   liveness information for the graph
51  */
52 be_uses_t *be_begin_uses(ir_graph *irg, const be_lv_t *lv);
53
54 /**
55  * Destroys the given uses environment.
56  *
57  * @param uses  the environment
58  */
59 void be_end_uses(be_uses_t *uses);
60
61 #endif