projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shouldn't be here anymore
[libfirm]
/
ir
/
be
/
beilpsched.c
diff --git
a/ir/be/beilpsched.c
b/ir/be/beilpsched.c
index
8381899
..
28b7022
100644
(file)
--- a/
ir/be/beilpsched.c
+++ b/
ir/be/beilpsched.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-200
7
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-200
8
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-56,13
+56,13
@@
#include "irprintf.h"
#include "plist.h"
#include "irprintf.h"
#include "irprintf.h"
#include "plist.h"
#include "irprintf.h"
+#include "timing.h"
#include <lpp/lpp.h>
#include <lpp/lpp_net.h>
#include <lpp/lpp.h>
#include <lpp/lpp_net.h>
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-#include <libcore/lc_timing.h>
+#include "lc_opts.h"
+#include "lc_opts_enum.h"
#include "be.h"
#include "benode_t.h"
#include "be.h"
#include "benode_t.h"
@@
-139,7
+139,7
@@
typedef union _ilpsched_attr_ {
/* A irn for the phase and it's attributes (either node or block) */
typedef struct {
/* A irn for the phase and it's attributes (either node or block) */
typedef struct {
-
ir_node
*irn;
+
const ir_node
*irn;
ilpsched_attr_t attr;
} be_ilpsched_irn_t;
ilpsched_attr_t attr;
} be_ilpsched_irn_t;
@@
-194,9
+194,9
@@
typedef struct {
/* check if a double value is within an epsilon environment of 0 */
#define LPP_VALUE_IS_0(dbl) (fabs((dbl)) <= 1e-10)
/* check if a double value is within an epsilon environment of 0 */
#define LPP_VALUE_IS_0(dbl) (fabs((dbl)) <= 1e-10)
-#define ilp_timer_push(t)
lc
_timer_push((t))
-#define ilp_timer_pop()
lc
_timer_pop()
-#define ilp_timer_elapsed_usec(t)
lc
_timer_elapsed_usec((t))
+#define ilp_timer_push(t)
ir
_timer_push((t))
+#define ilp_timer_pop()
ir
_timer_pop()
+#define ilp_timer_elapsed_usec(t)
ir
_timer_elapsed_usec((t))
/* option variable */
static ilpsched_options_t ilp_opts = {
/* option variable */
static ilpsched_options_t ilp_opts = {
@@
-261,8
+261,8
@@
static int cmp_ilpsched_irn(const void *a, const void *b) {
ilpsched_node_attr_t *n2_a = get_ilpsched_node_attr(n2);
if (n1_a->sched_point == n2_a->sched_point) {
ilpsched_node_attr_t *n2_a = get_ilpsched_node_attr(n2);
if (n1_a->sched_point == n2_a->sched_point) {
- ir_node *irn_a = n1->irn;
- ir_node *irn_b = n2->irn;
+
const
ir_node *irn_a = n1->irn;
+
const
ir_node *irn_b = n2->irn;
if (heights_reachable_in_block(glob_heights, irn_a, irn_b))
return 1;
if (heights_reachable_in_block(glob_heights, irn_a, irn_b))
return 1;
@@
-282,7
+282,7
@@
static int cmp_ilpsched_irn(const void *a, const void *b) {
/**
* In case there is no phase information for irn, initialize it.
*/
/**
* In case there is no phase information for irn, initialize it.
*/
-static void *init_ilpsched_irn(ir_phase *ph, ir_node *irn, void *old) {
+static void *init_ilpsched_irn(ir_phase *ph,
const
ir_node *irn, void *old) {
be_ilpsched_irn_t *res = old ? old : phase_alloc(ph, sizeof(res[0]));
if (res == old) {
be_ilpsched_irn_t *res = old ? old : phase_alloc(ph, sizeof(res[0]));
if (res == old) {
@@
-686,7
+686,7
@@
static void refine_asap_alap_times(ir_node *irn, void *walk_env) {
*
*******************************************/
*
*******************************************/
-static INLINE void check_for_keeps(waitq *keeps,
ir_node *block,
ir_node *irn) {
+static INLINE void check_for_keeps(waitq *keeps,
const ir_node *block, const
ir_node *irn) {
const ir_edge_t *edge;
(void) block;
const ir_edge_t *edge;
(void) block;
@@
-704,7
+704,7
@@
static INLINE void check_for_keeps(waitq *keeps, ir_node *block, ir_node *irn) {
* Inserts @p irn before @p before into schedule and notifies backend.
*/
static INLINE void notified_sched_add_before(be_ilpsched_env_t *env,
* Inserts @p irn before @p before into schedule and notifies backend.
*/
static INLINE void notified_sched_add_before(be_ilpsched_env_t *env,
-
ir_node *before,
ir_node *irn, unsigned cycle)
+
const ir_node *before, const
ir_node *irn, unsigned cycle)
{
be_ilp_sched_node_scheduled(env->sel, irn, cycle, env->block_env);
sched_add_before(before, irn);
{
be_ilp_sched_node_scheduled(env->sel, irn, cycle, env->block_env);
sched_add_before(before, irn);
@@
-714,7
+714,7
@@
static INLINE void notified_sched_add_before(be_ilpsched_env_t *env,
* Adds a node, it's Projs (in case of mode_T nodes) and
* it's Keeps to schedule.
*/
* Adds a node, it's Projs (in case of mode_T nodes) and
* it's Keeps to schedule.
*/
-static void add_to_sched(be_ilpsched_env_t *env,
ir_node *block,
ir_node *irn, unsigned cycle) {
+static void add_to_sched(be_ilpsched_env_t *env,
const ir_node *block, const
ir_node *irn, unsigned cycle) {
const ir_edge_t *edge;
waitq *keeps = new_waitq();
const ir_edge_t *edge;
waitq *keeps = new_waitq();
@@
-940,7
+940,7
@@
static int be_ilpsched_set_type_info(be_ilpsched_env_t *env, ir_node *irn, struc
* Returns the largest alap time of a user of @p irn.
* The user must be in block @p block.
*/
* Returns the largest alap time of a user of @p irn.
* The user must be in block @p block.
*/
-static unsigned be_ilpsched_get_max_alap_user(be_ilpsched_env_t *env,
ir_node *irn,
ir_node *block) {
+static unsigned be_ilpsched_get_max_alap_user(be_ilpsched_env_t *env,
const ir_node *irn, const
ir_node *block) {
const ir_edge_t *edge;
unsigned max_alap = 0;
const ir_edge_t *edge;
unsigned max_alap = 0;
@@
-980,7
+980,7
@@
static void create_variables(be_ilpsched_env_t *env, lpp_t *lpp, be_ilpsched_irn
ilp_livein_node_t *livein;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
unsigned weigth_y = ba->n_interesting_nodes * ba->n_interesting_nodes;
ilp_livein_node_t *livein;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
unsigned weigth_y = ba->n_interesting_nodes * ba->n_interesting_nodes;
-
lc_timer_t *t_var = lc
_timer_register("beilpsched_var", "create ilp variables");
+
ir_timer_t *t_var = ir
_timer_register("beilpsched_var", "create ilp variables");
ilp_timer_push(t_var);
num_block_var = num_nodes = 0;
ilp_timer_push(t_var);
num_block_var = num_nodes = 0;
@@
-1162,8
+1162,8
@@
static void create_assignment_and_precedence_constraints(be_ilpsched_env_t *env,
ir_node *irn;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
bitset_t *bs_block_irns = bitset_alloca(ba->block_last_idx);
ir_node *irn;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
bitset_t *bs_block_irns = bitset_alloca(ba->block_last_idx);
-
lc_timer_t *t_cst_assign = lc
_timer_register("beilpsched_cst_assign", "create assignment constraints");
-
lc_timer_t *t_cst_prec = lc
_timer_register("beilpsched_cst_prec", "create precedence constraints");
+
ir_timer_t *t_cst_assign = ir
_timer_register("beilpsched_cst_assign", "create assignment constraints");
+
ir_timer_t *t_cst_prec = ir
_timer_register("beilpsched_cst_prec", "create precedence constraints");
num_cst_assign = num_cst_prec = num_cst_dead = 0;
foreach_linked_irns(ba->head_ilp_nodes, irn) {
num_cst_assign = num_cst_prec = num_cst_dead = 0;
foreach_linked_irns(ba->head_ilp_nodes, irn) {
@@
-1293,7
+1293,7
@@
static void create_ressource_constraints(be_ilpsched_env_t *env, lpp_t *lpp, be_
char buf[1024];
unsigned num_cst_resrc = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
char buf[1024];
unsigned num_cst_resrc = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
-
lc_timer_t *t_cst_rsrc = lc
_timer_register("beilpsched_cst_rsrc", "create resource constraints");
+
ir_timer_t *t_cst_rsrc = ir
_timer_register("beilpsched_cst_rsrc", "create resource constraints");
ilp_timer_push(t_cst_rsrc);
for (glob_type_idx = env->cpu->n_unit_types - 1; glob_type_idx >= 0; --glob_type_idx) {
ilp_timer_push(t_cst_rsrc);
for (glob_type_idx = env->cpu->n_unit_types - 1; glob_type_idx >= 0; --glob_type_idx) {
@@
-1349,7
+1349,7
@@
static void create_bundle_constraints(be_ilpsched_env_t *env, lpp_t *lpp, be_ilp
unsigned num_cst_bundle = 0;
unsigned n_instr_max = env->cpu->bundle_size * env->cpu->bundels_per_cycle;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
unsigned num_cst_bundle = 0;
unsigned n_instr_max = env->cpu->bundle_size * env->cpu->bundels_per_cycle;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
-
lc_timer_t *t_cst_bundle = lc
_timer_register("beilpsched_cst_bundle", "create bundle constraints");
+
ir_timer_t *t_cst_bundle = ir
_timer_register("beilpsched_cst_bundle", "create bundle constraints");
ilp_timer_push(t_cst_bundle);
for (t = 0; t < ba->max_steps; ++t) {
ilp_timer_push(t_cst_bundle);
for (t = 0; t < ba->max_steps; ++t) {
@@
-1405,7
+1405,7
@@
static void create_alive_nodes_constraint(be_ilpsched_env_t *env, lpp_t *lpp, be
ir_node *irn;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
ir_node *irn;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
-
lc_timer_t *t_cst = lc
_timer_register("beilpsched_cst_alive_nodes", "create alive nodes constraints");
+
ir_timer_t *t_cst = ir
_timer_register("beilpsched_cst_alive_nodes", "create alive nodes constraints");
ilp_timer_push(t_cst);
/* for each node */
ilp_timer_push(t_cst);
/* for each node */
@@
-1487,7
+1487,7
@@
static void create_alive_livein_nodes_constraint(be_ilpsched_env_t *env, lpp_t *
ilp_livein_node_t *livein;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
ilp_livein_node_t *livein;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
-
lc_timer_t *t_cst = lc
_timer_register("beilpsched_cst_alive_livein_nodes", "create alive livein nodes constraints");
+
ir_timer_t *t_cst = ir
_timer_register("beilpsched_cst_alive_livein_nodes", "create alive livein nodes constraints");
ilp_timer_push(t_cst);
/* for each node */
ilp_timer_push(t_cst);
/* for each node */
@@
-1566,7
+1566,7
@@
static void create_pressure_alive_constraint(be_ilpsched_env_t *env, lpp_t *lpp,
ir_node *cur_irn;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
ir_node *cur_irn;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
-
lc_timer_t *t_cst = lc
_timer_register("beilpsched_cst_pressure", "create pressure constraints");
+
ir_timer_t *t_cst = ir
_timer_register("beilpsched_cst_pressure", "create pressure constraints");
ilp_timer_push(t_cst);
/* y_{nt}^k is set for each node and timestep and unit type */
ilp_timer_push(t_cst);
/* y_{nt}^k is set for each node and timestep and unit type */
@@
-1669,7
+1669,7
@@
static void create_branch_constraint(be_ilpsched_env_t *env, lpp_t *lpp, be_ilps
unsigned num_cst = 0;
unsigned num_non_branches = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
unsigned num_cst = 0;
unsigned num_non_branches = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
-
lc_timer_t *t_cst = lc
_timer_register("beilpsched_cst_branch", "create branch constraints");
+
ir_timer_t *t_cst = ir
_timer_register("beilpsched_cst_branch", "create branch constraints");
ilp_timer_push(t_cst);
cfop = NULL;
ilp_timer_push(t_cst);
cfop = NULL;
@@
-1761,7
+1761,7
@@
static void create_proj_keep_constraints(be_ilpsched_env_t *env, lpp_t *lpp, be_
ir_node *irn;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
ir_node *irn;
unsigned num_cst = 0;
ilpsched_block_attr_t *ba = get_ilpsched_block_attr(block_node);
-
lc_timer_t *t_cst = lc
_timer_register("beilpsched_cst_projkeep", "create proj and keep constraints");
+
ir_timer_t *t_cst = ir
_timer_register("beilpsched_cst_projkeep", "create proj and keep constraints");
ilp_timer_push(t_cst);
/* check all nodes */
ilp_timer_push(t_cst);
/* check all nodes */