Commit 30287295 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove the (mis-)feature of arch_get_irn_reg_req_out working on mode_T nodes...

remove the (mis-)feature of arch_get_irn_reg_req_out working on mode_T nodes and retruning no_reqs in this case

[r27648]
parent 3a655a31
......@@ -2412,6 +2412,8 @@ static void collect_stack_nodes_walker(ir_node *node, void *data)
if (arch_irn_get_n_outs(insn) == 0)
return;
if (get_irn_mode(node) == mode_T)
return;
req = arch_get_register_req_out(node);
if (! (req->type & arch_register_req_type_produces_sp))
......
......@@ -38,6 +38,7 @@
#include "beinfo.h"
#include "be.h"
#include "beirg.h"
#include "error.h"
typedef enum arch_register_class_flags_t {
arch_register_class_flag_none = 0,
......@@ -774,13 +775,16 @@ static inline const arch_register_req_t *arch_get_register_req_out(
int pos = 0;
backend_info_t *info;
/* you have to query the Proj nodes for the constraints (or use
* arch_get_out_register_req. Querying a mode_T node and expecting
* arch_no_register_req is a bug in your code! */
assert(get_irn_mode(irn) != mode_T);
if (is_Proj(irn)) {
pos = get_Proj_proj(irn);
irn = get_Proj_pred(irn);
} else if (get_irn_mode(irn) == mode_T) {
/* TODO: find out who does this and fix the caller! */
return arch_no_register_req;
}
info = be_get_info(irn);
if (info->out_infos == NULL)
return arch_no_register_req;
......
......@@ -391,10 +391,13 @@ static int ou_max_ind_set_costs(unit_t *ou)
static void co_collect_units(ir_node *irn, void *env)
{
const arch_register_req_t *req = arch_get_register_req_out(irn);
const arch_register_req_t *req;
copy_opt_t *co = env;
unit_t *unit;
if (get_irn_mode(irn) == mode_T)
return;
req = arch_get_register_req_out(irn);
if (req->cls != co->cls)
return;
if (!co_is_optimizable_root(irn))
......@@ -796,11 +799,14 @@ static inline void add_edges(copy_opt_t *co, ir_node *n1, ir_node *n2, int costs
static void build_graph_walker(ir_node *irn, void *env)
{
const arch_register_req_t *req = arch_get_register_req_out(irn);
const arch_register_req_t *req;
copy_opt_t *co = env;
int pos, max;
const arch_register_t *reg;
if (get_irn_mode(irn) == mode_T)
return;
req = arch_get_register_req_out(irn);
if (req->cls != co->cls || arch_irn_is_ignore(irn))
return;
......
......@@ -119,6 +119,9 @@ static int count_result(const ir_node* irn)
if (mode == mode_M || mode == mode_X)
return 0;
if (mode == mode_T)
return 1;
if (arch_get_register_req_out(irn)->type & arch_register_req_type_ignore)
return 0;
......@@ -194,9 +197,14 @@ static int normal_tree_cost(ir_node* irn, instance_t *inst)
last = 0;
for (i = 0; i < arity; ++i) {
ir_node* op = fc->costs[i].irn;
if (op == last) continue;
if (get_irn_mode(op) == mode_M) continue;
if (arch_irn_is_ignore(op)) continue;
ir_mode* mode;
if (op == last)
continue;
mode = get_irn_mode(op);
if (mode == mode_M)
continue;
if (mode != mode_T && arch_irn_is_ignore(op))
continue;
cost = MAX(fc->costs[i].cost + n_op_res, cost);
last = op;
++n_op_res;
......
......@@ -564,6 +564,9 @@ static int is_value_available(spill_env_t *env, const ir_node *arg,
(void)reloader;
if (get_irn_mode(arg) == mode_T)
return 0;
/*
* Ignore registers are always available
*/
......
......@@ -755,9 +755,7 @@ static vfp_liveness vfp_liveness_transfer(ir_node *irn, vfp_liveness live)
live &= ~(1 << arch_register_get_index(reg));
}
}
}
if (arch_irn_consider_in_reg_alloc(cls, irn)) {
} else if (arch_irn_consider_in_reg_alloc(cls, irn)) {
const arch_register_t *reg = x87_get_irn_register(irn);
live &= ~(1 << arch_register_get_index(reg));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment