#include <stdbool.h>
#include "obst.h"
-#include "irprintf_t.h"
#include "irgraph.h"
#include "irnode.h"
#include "irmode.h"
#include "irprintf.h"
#include "irnodeset.h"
#include "irtools.h"
+#include "statev_t.h"
#include "util.h"
#include "beutil.h"
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;
loc_t *delayed;
unsigned len;
unsigned i;
- int in;
unsigned ws_count;
int free_slots, free_pressure_slots;
unsigned pressure;
arity = get_irn_arity(block);
pred_worksets = ALLOCAN(workset_t*, arity);
all_preds_known = true;
- for (in = 0; in < arity; ++in) {
+ for (int 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);
}
/* 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;
-
if (all_preds_known) {
available = available_in_all_preds(pred_worksets, arity, node, false);
} else {
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()) */
/* 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);
- }
+ );
displace(new_vals, 1);
/* allocate all values _defined_ by this instruction */