projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sparc: implement float->unsigned conversions
[libfirm]
/
ir
/
be
/
bespilldaemel.c
diff --git
a/ir/be/bespilldaemel.c
b/ir/be/bespilldaemel.c
index
85f6f46
..
4f058bf
100644
(file)
--- a/
ir/be/bespilldaemel.c
+++ b/
ir/be/bespilldaemel.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-20
08
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-20
11
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-22,7
+22,6
@@
* @brief Naive spilling algorithm
* @author Matthias Braun
* @date 20.09.2005
* @brief Naive spilling algorithm
* @author Matthias Braun
* @date 20.09.2005
- * @version $Id: bespillbelady.c 13913 2007-05-18 12:48:56Z matze $
* @brief
* This implements a naive spilling algorithm. It is designed to produce
* similar effects to the spill decisions produced by traditional graph
* @brief
* This implements a naive spilling algorithm. It is designed to produce
* similar effects to the spill decisions produced by traditional graph
@@
-57,7
+56,7
@@
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
static spill_env_t *spill_env;
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
static spill_env_t *spill_env;
-static
int
n_regs;
+static
unsigned
n_regs;
static const arch_register_class_t *cls;
static const be_lv_t *lv;
static bitset_t *spilled_nodes;
static const arch_register_class_t *cls;
static const be_lv_t *lv;
static bitset_t *spilled_nodes;
@@
-70,8
+69,8
@@
struct spill_candidate_t {
static int compare_spill_candidates_desc(const void *d1, const void *d2)
{
static int compare_spill_candidates_desc(const void *d1, const void *d2)
{
- const spill_candidate_t *c1 = d1;
- const spill_candidate_t *c2 = d2;
+ const spill_candidate_t *c1 =
(const spill_candidate_t*)
d1;
+ const spill_candidate_t *c2 =
(const spill_candidate_t*)
d2;
return (int) (c1->costs - c2->costs);
}
return (int) (c1->costs - c2->costs);
}
@@
-135,7
+134,7
@@
static void spill_node(ir_node *node)
static unsigned get_value_width(const ir_node *node)
{
static unsigned get_value_width(const ir_node *node)
{
- const arch_register_req_t *req = arch_get_
register_req_out
(node);
+ const arch_register_req_t *req = arch_get_
irn_register_req
(node);
return req->width;
}
return req->width;
}
@@
-150,7
+149,8
@@
static void do_spilling(ir_nodeset_t *live_nodes, ir_node *node)
size_t free_regs_needed = 0;
spill_candidate_t *candidates;
ir_nodeset_iterator_t iter;
size_t free_regs_needed = 0;
spill_candidate_t *candidates;
ir_nodeset_iterator_t iter;
- size_t i, arity;
+ int i, arity;
+ size_t c;
int spills_needed;
size_t cand_idx;
ir_node *n;
int spills_needed;
size_t cand_idx;
ir_node *n;
@@
-184,17
+184,17
@@
static void do_spilling(ir_nodeset_t *live_nodes, ir_node *node)
candidates = ALLOCAN(spill_candidate_t, n_live_nodes);
/* construct array with spill candidates and calculate their costs */
candidates = ALLOCAN(spill_candidate_t, n_live_nodes);
/* construct array with spill candidates and calculate their costs */
-
i
= 0;
+
c
= 0;
foreach_ir_nodeset(live_nodes, n, iter) {
foreach_ir_nodeset(live_nodes, n, iter) {
- spill_candidate_t *candidate = & candidates[
i
];
+ spill_candidate_t *candidate = & candidates[
c
];
assert(!bitset_is_set(spilled_nodes, get_irn_idx(n)));
candidate->node = n;
candidate->costs = get_spill_costs(n);
assert(!bitset_is_set(spilled_nodes, get_irn_idx(n)));
candidate->node = n;
candidate->costs = get_spill_costs(n);
- ++
i
;
+ ++
c
;
}
}
- assert(
i
== n_live_nodes);
+ assert(
c
== n_live_nodes);
/* sort spill candidates */
qsort(candidates, n_live_nodes, sizeof(candidates[0]),
/* sort spill candidates */
qsort(candidates, n_live_nodes, sizeof(candidates[0]),
@@
-369,7
+369,7
@@
static void be_spill_daemel(ir_graph *irg, const arch_register_class_t *new_cls)
if (n_regs == 0)
return;
if (n_regs == 0)
return;
- be_
liveness_assure_sets(be_assure_liveness(irg)
);
+ be_
assure_live_sets(irg
);
spill_env = be_new_spill_env(irg);
cls = new_cls;
spill_env = be_new_spill_env(irg);
cls = new_cls;
@@
-386,7
+386,7
@@
static void be_spill_daemel(ir_graph *irg, const arch_register_class_t *new_cls)
be_delete_spill_env(spill_env);
}
be_delete_spill_env(spill_env);
}
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_daemelspill)
;
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_daemelspill)
void be_init_daemelspill(void)
{
static be_spiller_t daemel_spiller = {
void be_init_daemelspill(void)
{
static be_spiller_t daemel_spiller = {