2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Common stuff used by all ILP formulations.
12 #ifndef FIRM_BE_BECOPYILP_T_H
13 #define FIRM_BE_BECOPYILP_T_H
15 #include "firm_types.h"
16 #include "becopyopt_t.h"
18 /******************************************************************************
20 / ____| (_) |_ _| | | __ \
21 | | __ ___ _ __ ___ _ __ _ ___ | | | | | |__) |
22 | | |_ |/ _ \ '_ \ / _ \ '__| |/ __| | | | | | ___/
23 | |__| | __/ | | | __/ | | | (__ _| |_| |____| |
24 \_____|\___|_| |_|\___|_| |_|\___| |_____|______|_|
26 *****************************************************************************/
31 #define EPSILON 0.00001
33 typedef struct ilp_env_t ilp_env_t;
35 typedef void(*ilp_callback)(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 */
47 ilp_env_t *new_ilp_env(copy_opt_t *co, ilp_callback build, ilp_callback apply, void *env);
49 lpp_sol_state_t ilp_go(ilp_env_t *ienv);
51 void free_ilp_env(ilp_env_t *ienv);
54 * Checks if a node has already been removed
56 static inline bool sr_is_removed(ilp_env_t const *const ienv, ir_node const *const irn)
58 return ir_nodeset_contains(&ienv->all_removed, irn);