ia32: Remove the unnecessary special case to get the latency of a CopyB.
[libfirm] / ir / be / becopyilp_t.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief       Common stuff used by all ILP formulations.
9  * @author      Daniel Grund
10  * @date        28.02.2006
11  */
12 #ifndef FIRM_BE_BECOPYILP_T_H
13 #define FIRM_BE_BECOPYILP_T_H
14
15 #include "firm_types.h"
16 #include "becopyopt_t.h"
17
18 /******************************************************************************
19     _____                      _        _____ _      _____
20    / ____|                    (_)      |_   _| |    |  __ \
21   | |  __  ___ _ __   ___ _ __ _  ___    | | | |    | |__) |
22   | | |_ |/ _ \ '_ \ / _ \ '__| |/ __|   | | | |    |  ___/
23   | |__| |  __/ | | |  __/ |  | | (__   _| |_| |____| |
24    \_____|\___|_| |_|\___|_|  |_|\___| |_____|______|_|
25
26  *****************************************************************************/
27
28 #include "lpp.h"
29 #include "lpp_net.h"
30
31 #define EPSILON 0.00001
32
33 typedef struct ilp_env_t ilp_env_t;
34
35 typedef void(*ilp_callback)(ilp_env_t*);
36
37 struct ilp_env_t {
38         copy_opt_t const *co;          /**< the copy opt problem */
39         ir_node         **col_suff;    /**< Coloring suffix for size reduction. A PEO prefix. */
40         ir_nodeset_t      all_removed; /**< All nodes removed during problem size reduction */
41         lpp_t            *lp;          /**< the linear programming problem */
42         void             *env;
43         ilp_callback     build;
44         ilp_callback     apply;
45 };
46
47 ilp_env_t *new_ilp_env(copy_opt_t *co, ilp_callback build, ilp_callback apply, void *env);
48
49 lpp_sol_state_t ilp_go(ilp_env_t *ienv);
50
51 void free_ilp_env(ilp_env_t *ienv);
52
53 /**
54  * Checks if a node has already been removed
55  */
56 static inline bool sr_is_removed(ilp_env_t const *const ienv, ir_node const *const irn)
57 {
58         return ir_nodeset_contains(&ienv->all_removed, irn);
59 }
60
61 #endif