projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bescripts: Remove unused execution unit specification.
[libfirm]
/
ir
/
be
/
bespillbelady.c
diff --git
a/ir/be/bespillbelady.c
b/ir/be/bespillbelady.c
index
360aa58
..
ad654a7
100644
(file)
--- a/
ir/be/bespillbelady.c
+++ b/
ir/be/bespillbelady.c
@@
-28,7
+28,6
@@
#include <stdbool.h>
#include "obst.h"
#include <stdbool.h>
#include "obst.h"
-#include "irprintf_t.h"
#include "irgraph.h"
#include "irnode.h"
#include "irmode.h"
#include "irgraph.h"
#include "irnode.h"
#include "irmode.h"
@@
-39,6
+38,7
@@
#include "irprintf.h"
#include "irnodeset.h"
#include "irtools.h"
#include "irprintf.h"
#include "irnodeset.h"
#include "irtools.h"
+#include "statev_t.h"
#include "util.h"
#include "beutil.h"
#include "util.h"
#include "beutil.h"
@@
-78,7
+78,7
@@
typedef struct loc_t {
typedef struct workset_t {
unsigned len; /**< current length */
typedef struct workset_t {
unsigned len; /**< current length */
- loc_t vals[
0];
/**< array of the values/distances in this working set */
+ loc_t vals[
];
/**< array of the values/distances in this working set */
} workset_t;
static struct obstack obst;
} workset_t;
static struct obstack obst;
@@
-89,7
+89,6
@@
static unsigned n_regs;
static workset_t *ws; /**< the main workset used while
processing a block. */
static be_uses_t *uses; /**< env for the next-use magic */
static workset_t *ws; /**< the main workset used while
processing a block. */
static be_uses_t *uses; /**< env for the next-use magic */
-static ir_node *instr; /**< current instruction */
static spill_env_t *senv; /**< see bespill.h */
static ir_node **blocklist;
static spill_env_t *senv; /**< see bespill.h */
static ir_node **blocklist;
@@
-324,7
+323,7
@@
static unsigned get_distance(ir_node *from, const ir_node *def, int skip_from_us
* @p is_usage indicates that the values in new_vals are used (not defined)
* In this case reloads must be performed
*/
* @p is_usage indicates that the values in new_vals are used (not defined)
* In this case reloads must be performed
*/
-static void displace(workset_t *
new_vals, int is_usage
)
+static void displace(workset_t *
const new_vals, int const is_usage, ir_node *const instr
)
{
ir_node **to_insert = ALLOCAN(ir_node*, n_regs);
bool *spilled = ALLOCAN(bool, n_regs);
{
ir_node **to_insert = ALLOCAN(ir_node*, n_regs);
bool *spilled = ALLOCAN(bool, n_regs);
@@
-482,11
+481,6
@@
static loc_t to_take_or_not_to_take(ir_node* first, ir_node *node,
loc.node = node;
loc.spilled = false;
loc.node = node;
loc.spilled = false;
- if (!arch_irn_consider_in_reg_alloc(cls, node)) {
- loc.time = USES_INFINITY;
- return loc;
- }
-
/* We have to keep nonspillable nodes in the workingset */
if (arch_get_irn_flags(skip_Proj_const(node)) & arch_irn_flags_dont_spill) {
loc.time = 0;
/* We have to keep nonspillable nodes in the workingset */
if (arch_get_irn_flags(skip_Proj_const(node)) & arch_irn_flags_dont_spill) {
loc.time = 0;
@@
-540,13
+534,11
@@
static void decide_start_workset(const ir_node *block)
{
ir_loop *loop = get_irn_loop(block);
ir_node *first;
{
ir_loop *loop = get_irn_loop(block);
ir_node *first;
- ir_node *node;
loc_t loc;
loc_t *starters;
loc_t *delayed;
unsigned len;
unsigned i;
loc_t loc;
loc_t *starters;
loc_t *delayed;
unsigned len;
unsigned i;
- int in;
unsigned ws_count;
int free_slots, free_pressure_slots;
unsigned pressure;
unsigned ws_count;
int free_slots, free_pressure_slots;
unsigned pressure;
@@
-558,7
+550,7
@@
static void decide_start_workset(const ir_node *block)
arity = get_irn_arity(block);
pred_worksets = ALLOCAN(workset_t*, arity);
all_preds_known = true;
arity = get_irn_arity(block);
pred_worksets = ALLOCAN(workset_t*, arity);
all_preds_known = true;
- for (in = 0; in < arity; ++in) {
+ for (in
t in
= 0; in < arity; ++in) {
ir_node *pred_block = get_Block_cfgpred_block(block, in);
block_info_t *pred_info = get_block_info(pred_block);
ir_node *pred_block = get_Block_cfgpred_block(block, in);
block_info_t *pred_info = get_block_info(pred_block);
@@
-605,10
+597,8
@@
static void decide_start_workset(const ir_node *block)
}
/* check all Live-Ins */
}
/* check all Live-Ins */
- be_lv_foreach(lv, block, be_lv_state_in, in) {
- ir_node *node = be_lv_get_irn(lv, block, in);
+ be_lv_foreach_cls(lv, block, be_lv_state_in, cls, node) {
unsigned available;
unsigned available;
-
if (all_preds_known) {
available = available_in_all_preds(pred_worksets, arity, node, false);
} else {
if (all_preds_known) {
available = available_in_all_preds(pred_worksets, arity, node, false);
} else {
@@
-761,7
+751,6
@@
static void decide_start_workset(const ir_node *block)
static void process_block(ir_node *block)
{
workset_t *new_vals;
static void process_block(ir_node *block)
{
workset_t *new_vals;
- ir_node *irn;
unsigned iter;
block_info_t *block_info;
int arity;
unsigned iter;
block_info_t *block_info;
int arity;
@@
-793,9
+782,11
@@
static void process_block(ir_node *block)
set_block_info(block, block_info);
DB((dbg, DBG_WSETS, "Start workset for %+F:\n", block));
set_block_info(block, block_info);
DB((dbg, DBG_WSETS, "Start workset for %+F:\n", block));
- workset_foreach(ws, irn, iter) {
- DB((dbg, DBG_WSETS, " %+F (%u)\n", irn,
- workset_get_time(ws, iter)));
+ {
+ ir_node *irn;
+ workset_foreach(ws, irn, iter) {
+ DB((dbg, DBG_WSETS, " %+F (%u)\n", irn, workset_get_time(ws, iter)));
+ }
}
block_info->start_workset = workset_clone(ws);
}
block_info->start_workset = workset_clone(ws);
@@
-806,8
+797,6
@@
static void process_block(ir_node *block)
new_vals = new_workset();
sched_foreach(block, irn) {
new_vals = new_workset();
sched_foreach(block, irn) {
- int i, arity;
- ir_node *value;
assert(workset_get_length(ws) <= n_regs);
/* Phis are no real instr (see insert_starters()) */
assert(workset_get_length(ws) <= n_regs);
/* Phis are no real instr (see insert_starters()) */
@@
-816,35
+805,31
@@
static void process_block(ir_node *block)
}
DB((dbg, DBG_DECIDE, " ...%+F\n", irn));
}
DB((dbg, DBG_DECIDE, " ...%+F\n", irn));
- /* set instruction in the workset */
- instr = irn;
-
/* allocate all values _used_ by this instruction */
workset_clear(new_vals);
/* allocate all values _used_ by this instruction */
workset_clear(new_vals);
- for (i = 0, arity = get_irn_arity(irn); i < arity; ++i) {
- ir_node *in = get_irn_n(irn, i);
- if (!arch_irn_consider_in_reg_alloc(cls, in))
- continue;
-
+ be_foreach_use(irn, cls, in_req_, in, in_req,
/* (note that "spilled" is irrelevant here) */
workset_insert(new_vals, in, false);
/* (note that "spilled" is irrelevant here) */
workset_insert(new_vals, in, false);
- }
- displace(new_vals, 1);
+ );
+ displace(new_vals, 1
, irn
);
/* allocate all values _defined_ by this instruction */
workset_clear(new_vals);
/* allocate all values _defined_ by this instruction */
workset_clear(new_vals);
- be_foreach_definition(irn, cls, value,
- assert(req
_
->width == 1);
+ be_foreach_definition(irn, cls, value,
req,
+ assert(req->width == 1);
workset_insert(new_vals, value, false);
);
workset_insert(new_vals, value, false);
);
- displace(new_vals, 0);
+ displace(new_vals, 0
, irn
);
}
/* Remember end-workset for this block */
block_info->end_workset = workset_clone(ws);
DB((dbg, DBG_WSETS, "End workset for %+F:\n", block));
}
/* Remember end-workset for this block */
block_info->end_workset = workset_clone(ws);
DB((dbg, DBG_WSETS, "End workset for %+F:\n", block));
- workset_foreach(ws, irn, iter)
- DB((dbg, DBG_WSETS, " %+F (%u)\n", irn, workset_get_time(ws, iter)));
+ {
+ ir_node *irn;
+ workset_foreach(ws, irn, iter)
+ DB((dbg, DBG_WSETS, " %+F (%u)\n", irn, workset_get_time(ws, iter)));
+ }
}
/**
}
/**