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

node_cmp_attr changed to node_attrs_equal and code cleaned up

parent ef0dc78a
......@@ -145,9 +145,9 @@ typedef ir_node *(*transform_node_func)(ir_node *self);
/**
* The node attribute compare operation.
* Compares the nodes attributes of two nodes of identical opcode
* and returns 0 if the attributes are identical, 1 if they differ.
* and returns 1 if the attributes are identical, 0 if they differ.
*/
typedef int (*node_cmp_attr_func)(const ir_node *a, const ir_node *b);
typedef int (*node_attrs_equal_func)(const ir_node *a, const ir_node *b);
/**
* The reassociation operation.
......@@ -227,8 +227,8 @@ FIRM_API void set_op_equivalent_node_proj(ir_op *op, equivalent_node_func func);
FIRM_API void set_op_transform_node(ir_op *op, transform_node_func func);
/** Sets transform Proj node callback @p func for operation @p op */
FIRM_API void set_op_transform_node_proj(ir_op *op, transform_node_func func);
/** Sets cmp_attr callback @p func for operation @p op */
FIRM_API void set_op_cmp_attr(ir_op *op, node_cmp_attr_func func);
/** Sets attrs_equal callback @p func for operation @p op */
FIRM_API void set_op_attrs_equal(ir_op *op, node_attrs_equal_func func);
/** Sets reassociation callback @p func for operation @p op */
FIRM_API void set_op_reassociate(ir_op *op, reassociate_func func);
/** Sets attribute copy callback @p func for operation @p op */
......
......@@ -93,14 +93,11 @@ static void set_TEMPLATE_value(ir_node *node, ir_tarval *value)
attr->value = value;
}
static int TEMPLATE_compare_attr(const ir_node *a, const ir_node *b)
static int TEMPLATE_attrs_equal(const ir_node *a, const ir_node *b)
{
const TEMPLATE_attr_t *attr_a = get_TEMPLATE_attr_const(a);
const TEMPLATE_attr_t *attr_b = get_TEMPLATE_attr_const(b);
(void) attr_a;
(void) attr_b;
return 0;
return attr_a->value == attr_b->value;
}
static void TEMPLATE_copy_attr(ir_graph *irg, const ir_node *old_node,
......
......@@ -22,7 +22,6 @@ $mode_fp = "mode_F"; # mode used by floatingpoint registers
# ],
# comment => "any comment for constructor", # optional
# reg_req => { in => [ "reg_class|register" ], out => [ "reg_class|register|in_rX" ] },
# cmp_attr => "c source code for comparing node attributes", # optional
# outs => { "out1", "out2" },# optional, creates pn_op_out1, ... consts
# ins => { "in1", "in2" }, # optional, creates n_op_in1, ... consts
# mode => "mode_Iu", # optional, predefines the mode
......@@ -187,12 +186,7 @@ Const => {
custominit => "set_TEMPLATE_value(res, value);",
reg_req => { out => [ "gp" ] },
emit => 'mov %I, %D1',
cmp_attr =>
'
/* TODO: compare Const attributes */
return 1;
',
mode => $mode_gp,
mode => $mode_gp,
},
# Control Flow
......@@ -278,11 +272,6 @@ fConst => {
irn_flags => [ "rematerializable" ],
reg_req => { out => [ "fp" ] },
emit => 'fmov %I, %D1',
cmp_attr =>
'
/* TODO: compare fConst attributes */
return 1;
',
mode => $mode_fp,
},
......
......@@ -158,100 +158,96 @@ static void init_amd64_movimm_attributes(ir_node *node,
attr->immediate.offset = offset;
}
static int cmp_imm32(const amd64_imm32_t *const imm0,
const amd64_imm32_t *const imm1)
static bool imm32s_equal(const amd64_imm32_t *const imm0,
const amd64_imm32_t *const imm1)
{
return imm0->offset != imm1->offset || imm0->entity != imm1->entity;
return imm0->offset == imm1->offset && imm0->entity == imm1->entity;
}
static int cmp_imm64(const amd64_imm64_t *const imm0,
const amd64_imm64_t *const imm1)
static bool imm64s_equal(const amd64_imm64_t *const imm0,
const amd64_imm64_t *const imm1)
{
return imm0->offset != imm1->offset || imm0->entity != imm1->entity;
return imm0->offset == imm1->offset && imm0->entity == imm1->entity;
}
static int cmp_addr(const amd64_addr_t *const am0,
const amd64_addr_t *const am1)
static bool amd64_addrs_equal(const amd64_addr_t *const am0,
const amd64_addr_t *const am1)
{
return cmp_imm32(&am0->immediate, &am1->immediate)
|| am0->base_input != am1->base_input
|| am0->index_input != am1->index_input
|| am0->log_scale != am1->log_scale
|| am0->segment != am1->segment;
return imm32s_equal(&am0->immediate, &am1->immediate)
&& am0->base_input == am1->base_input
&& am0->index_input == am1->index_input
&& am0->log_scale == am1->log_scale
&& am0->segment == am1->segment;
}
static int cmp_amd64_attr(const ir_node *a, const ir_node *b)
static int amd64_attrs_equal(const ir_node *a, const ir_node *b)
{
const amd64_attr_t *attr_a = get_amd64_attr_const(a);
const amd64_attr_t *attr_b = get_amd64_attr_const(b);
return attr_a->op_mode != attr_b->op_mode;
return attr_a->op_mode == attr_b->op_mode;
}
static int cmp_amd64_addr_attr(const ir_node *a, const ir_node *b)
static int amd64_addr_attrs_equal(const ir_node *a, const ir_node *b)
{
const amd64_addr_attr_t *attr_a = get_amd64_addr_attr_const(a);
const amd64_addr_attr_t *attr_b = get_amd64_addr_attr_const(b);
return cmp_amd64_attr(a, b)
|| cmp_addr(&attr_a->addr, &attr_b->addr)
|| attr_a->insn_mode != attr_b->insn_mode
|| attr_a->needs_frame_ent != attr_b->needs_frame_ent;
return amd64_attrs_equal(a, b)
&& amd64_addrs_equal(&attr_a->addr, &attr_b->addr)
&& attr_a->insn_mode == attr_b->insn_mode
&& attr_a->needs_frame_ent == attr_b->needs_frame_ent;
}
static int cmp_amd64_binop_addr_attr(const ir_node *a,
const ir_node *b)
static int amd64_binop_addr_attrs_equal(const ir_node *a,
const ir_node *b)
{
const amd64_binop_addr_attr_t *attr_a = get_amd64_binop_addr_attr_const(a);
const amd64_binop_addr_attr_t *attr_b = get_amd64_binop_addr_attr_const(b);
if (cmp_amd64_addr_attr(a, b))
return 1;
if (!amd64_addr_attrs_equal(a, b))
return false;
amd64_op_mode_t op_mode = attr_a->base.base.op_mode;
if (op_mode == AMD64_OP_REG_IMM || op_mode == AMD64_OP_ADDR_IMM) {
return cmp_imm32(&attr_a->u.immediate, &attr_b->u.immediate);
return imm32s_equal(&attr_a->u.immediate, &attr_b->u.immediate);
} else {
return attr_a->u.reg_input != attr_b->u.reg_input;
return attr_a->u.reg_input == attr_b->u.reg_input;
}
}
static int cmp_amd64_movimm_attr(const ir_node *const a,
const ir_node *const b)
static int amd64_movimm_attrs_equal(const ir_node *const a,
const ir_node *const b)
{
const amd64_movimm_attr_t *const attr_a = get_amd64_movimm_attr_const(a);
const amd64_movimm_attr_t *const attr_b = get_amd64_movimm_attr_const(b);
return cmp_amd64_attr(a, b)
|| cmp_imm64(&attr_a->immediate, &attr_b->immediate)
|| attr_a->insn_mode != attr_b->insn_mode;
return amd64_attrs_equal(a, b)
&& imm64s_equal(&attr_a->immediate, &attr_b->immediate)
&& attr_a->insn_mode == attr_b->insn_mode;
}
static int cmp_amd64_shift_attr(const ir_node *const a,
const ir_node *const b)
static int amd64_shift_attrs_equal(const ir_node *const a,
const ir_node *const b)
{
const amd64_shift_attr_t *const attr_a = get_amd64_shift_attr_const(a);
const amd64_shift_attr_t *const attr_b = get_amd64_shift_attr_const(b);
return cmp_amd64_attr(a, b)
|| attr_a->immediate != attr_b->immediate
|| attr_a->insn_mode != attr_b->insn_mode;
return amd64_attrs_equal(a, b)
&& attr_a->immediate == attr_b->immediate
&& attr_a->insn_mode == attr_b->insn_mode;
}
static int cmp_amd64_cc_attr(const ir_node *const a,
const ir_node *const b)
static int amd64_cc_attrs_equal(const ir_node *const a,
const ir_node *const b)
{
if (cmp_amd64_attr(a, b))
return true;
const amd64_cc_attr_t *const attr_a = get_amd64_cc_attr_const(a);
const amd64_cc_attr_t *const attr_b = get_amd64_cc_attr_const(b);
return attr_a->cc != attr_b->cc;
return amd64_attrs_equal(a, b) && attr_a->cc == attr_b->cc;
}
static int cmp_amd64_switch_jmp_attr(const ir_node *const a,
const ir_node *const b)
static int amd64_switch_jmp_attrs_equal(const ir_node *const a,
const ir_node *const b)
{
if (cmp_amd64_attr(a, b))
return true;
const amd64_switch_jmp_attr_t *const attr_a
= get_amd64_switch_jmp_attr_const(a);
const amd64_switch_jmp_attr_t *const attr_b
= get_amd64_switch_jmp_attr_const(b);
return attr_a->table != attr_b->table;
return amd64_attrs_equal(a, b) && attr_a->table == attr_b->table;
}
static void amd64_copy_attr(ir_graph *irg, const ir_node *old_node,
......
......@@ -82,16 +82,6 @@ $default_copy_attr = "amd64_copy_attr";
."\t*attr = *attr_init;\n",
);
%compare_attr = (
amd64_addr_attr_t => "cmp_amd64_addr_attr",
amd64_attr_t => "cmp_amd64_attr",
amd64_binop_addr_attr_t => "cmp_amd64_binop_addr_attr",
amd64_cc_attr_t => "cmp_amd64_cc_attr",
amd64_movimm_attr_t => "cmp_amd64_movimm_attr",
amd64_shift_attr_t => "cmp_amd64_shift_attr",
amd64_switch_jmp_attr_t => "cmp_amd64_switch_jmp_attr",
);
%nodes = (
PushAM => {
op_flags => [ "uses_memory" ],
......
......@@ -363,58 +363,48 @@ static void init_arm_SwitchJmp_attributes(ir_node *res,
}
}
static int cmp_attr_arm(const ir_node *a, const ir_node *b)
static int arm_attrs_equal(const ir_node *a, const ir_node *b)
{
(void)a;
(void)b;
return 0;
return true;
}
static int cmp_attr_arm_Address(const ir_node *a, const ir_node *b)
static int arm_Address_attrs_equal(const ir_node *a, const ir_node *b)
{
if (cmp_attr_arm(a, b))
return 1;
const arm_Address_attr_t *attr_a = get_arm_Address_attr_const(a);
const arm_Address_attr_t *attr_b = get_arm_Address_attr_const(b);
return attr_a->entity != attr_b->entity
|| attr_a->fp_offset != attr_b->fp_offset;
return arm_attrs_equal(a, b)
&& attr_a->entity == attr_b->entity
&& attr_a->fp_offset == attr_b->fp_offset;
}
static int cmp_attr_arm_CopyB(const ir_node *a, const ir_node *b)
static int arm_CopyB_attrs_equal(const ir_node *a, const ir_node *b)
{
if (cmp_attr_arm(a, b))
return 1;
const arm_CopyB_attr_t *attr_a = get_arm_CopyB_attr_const(a);
const arm_CopyB_attr_t *attr_b = get_arm_CopyB_attr_const(b);
return attr_a->size != attr_b->size;
return arm_attrs_equal(a, b) && attr_a->size == attr_b->size;
}
static int cmp_attr_arm_CondJmp(const ir_node *a, const ir_node *b)
static int arm_CondJmp_attrs_equal(const ir_node *a, const ir_node *b)
{
(void)a;
(void)b;
/* never identical */
return 1;
const arm_CondJmp_attr_t *attr_a = get_arm_CondJmp_attr_const(a);
const arm_CondJmp_attr_t *attr_b = get_arm_CondJmp_attr_const(b);
return arm_attrs_equal(a, b) && attr_a->relation == attr_b->relation;
}
static int cmp_attr_arm_SwitchJmp(const ir_node *a, const ir_node *b)
static int arm_SwitchJmp_attrs_equal(const ir_node *a, const ir_node *b)
{
(void)a;
(void)b;
/* never identical */
return 1;
const arm_SwitchJmp_attr_t *attr_a = get_arm_SwitchJmp_attr_const(a);
const arm_SwitchJmp_attr_t *attr_b = get_arm_SwitchJmp_attr_const(b);
return arm_attrs_equal(a, b) && attr_a->table == attr_b->table;
}
static int cmp_attr_arm_fConst(const ir_node *a, const ir_node *b)
static int arm_fConst_attrs_equal(const ir_node *a, const ir_node *b)
{
if (cmp_attr_arm(a, b))
return 1;
const arm_fConst_attr_t *attr_a = get_arm_fConst_attr_const(a);
const arm_fConst_attr_t *attr_b = get_arm_fConst_attr_const(b);
return attr_a->tv != attr_b->tv;
return arm_attrs_equal(a, b) && attr_a->tv == attr_b->tv;
}
......@@ -449,57 +439,40 @@ const arm_cmp_attr_t *get_arm_cmp_attr_const(const ir_node *node)
return (const arm_cmp_attr_t*) get_irn_generic_attr_const(node);
}
static int cmp_attr_arm_load_store(const ir_node *a, const ir_node *b)
static int arm_load_store_attrs_equal(const ir_node *a, const ir_node *b)
{
if (cmp_attr_arm(a, b))
return 1;
const arm_load_store_attr_t *attr_a = get_arm_load_store_attr_const(a);
const arm_load_store_attr_t *attr_b = get_arm_load_store_attr_const(b);
if (attr_a->entity != attr_b->entity
|| attr_a->entity_sign != attr_b->entity_sign
|| attr_a->offset != attr_b->offset)
return 1;
return 0;
return arm_attrs_equal(a, b)
&& attr_a->entity == attr_b->entity
&& attr_a->entity_sign == attr_b->entity_sign
&& attr_a->offset == attr_b->offset;
}
static int cmp_attr_arm_shifter_operand(const ir_node *a, const ir_node *b)
static int arm_shifter_operands_equal(const ir_node *a, const ir_node *b)
{
if (cmp_attr_arm(a, b))
return 1;
const arm_shifter_operand_t *attr_a = get_arm_shifter_operand_attr_const(a);
const arm_shifter_operand_t *attr_b = get_arm_shifter_operand_attr_const(b);
if (attr_a->shift_modifier != attr_b->shift_modifier
|| attr_a->immediate_value != attr_b->immediate_value
|| attr_a->shift_immediate != attr_b->shift_immediate)
return 1;
return 0;
return arm_attrs_equal(a, b)
&& attr_a->shift_modifier == attr_b->shift_modifier
&& attr_a->immediate_value == attr_b->immediate_value
&& attr_a->shift_immediate == attr_b->shift_immediate;
}
static int cmp_attr_arm_cmp(const ir_node *a, const ir_node *b)
static int arm_cmp_attrs_equal(const ir_node *a, const ir_node *b)
{
if (cmp_attr_arm(a, b))
return 1;
const arm_cmp_attr_t *attr_a = get_arm_cmp_attr_const(a);
const arm_cmp_attr_t *attr_b = get_arm_cmp_attr_const(b);
if (attr_a->ins_permuted != attr_b->ins_permuted
|| attr_a->is_unsigned != attr_b->is_unsigned)
return 1;
return 0;
return arm_attrs_equal(a, b)
&& attr_a->ins_permuted == attr_b->ins_permuted
&& attr_a->is_unsigned == attr_b->is_unsigned;
}
static int cmp_attr_arm_farith(const ir_node *a, const ir_node *b)
static int arm_farith_attrs_equal(const ir_node *a, const ir_node *b)
{
if (cmp_attr_arm(a, b))
return 1;
const arm_farith_attr_t *attr_a = get_arm_farith_attr_const(a);
const arm_farith_attr_t *attr_b = get_arm_farith_attr_const(b);
return attr_a->mode != attr_b->mode;
return arm_attrs_equal(a, b) && attr_a->mode == attr_b->mode;
}
/** copies the ARM attributes of a node. */
......
......@@ -74,19 +74,6 @@ $default_copy_attr = "arm_copy_attr";
"\tinit_arm_CopyB_attributes(res, size);",
);
%compare_attr = (
arm_attr_t => "cmp_attr_arm",
arm_Address_attr_t => "cmp_attr_arm_Address",
arm_CondJmp_attr_t => "cmp_attr_arm_CondJmp",
arm_SwitchJmp_attr_t => "cmp_attr_arm_SwitchJmp",
arm_fConst_attr_t => "cmp_attr_arm_fConst",
arm_load_store_attr_t => "cmp_attr_arm_load_store",
arm_shifter_operand_t => "cmp_attr_arm_shifter_operand",
arm_CopyB_attr_t => "cmp_attr_arm_CopyB",
arm_cmp_attr_t => "cmp_attr_arm_cmp",
arm_farith_attr_t => "cmp_attr_arm_farith",
);
my %unop_shifter_operand_constructors = (
imm => {
attr => "unsigned char immediate_value, unsigned char immediate_rot",
......@@ -477,12 +464,12 @@ Bl => {
# this node produces ALWAYS an empty (tempary) gp reg and cannot be CSE'd
EmptyReg => {
op_flags => [ "constlike" ],
irn_flags => [ "rematerializable" ],
reg_req => { out => [ "gp" ] },
emit => '/* %D0 now available for calculations */',
cmp_attr => 'return 1;',
mode => $mode_gp,
op_flags => [ "constlike" ],
irn_flags => [ "rematerializable" ],
reg_req => { out => [ "gp" ] },
emit => '/* %D0 now available for calculations */',
attrs_equal => 'attrs_equal_false',
mode => $mode_gp,
},
CopyB => {
......
......@@ -78,26 +78,22 @@ static void new_phi_copy_attr(ir_graph *irg, const ir_node *old_node,
old_phi_copy_attr(irg, old_node, new_node);
}
int be_nodes_equal(const ir_node *node1, const ir_node *node2)
int attrs_equal_be_node(const ir_node *node1, const ir_node *node2)
{
const backend_info_t *info1 = be_get_info(node1);
const backend_info_t *info2 = be_get_info(node2);
size_t len = ARR_LEN(info1->out_infos);
int arity = get_irn_arity(node1);
int in;
size_t i;
if (ARR_LEN(info2->out_infos) != len)
return false;
int arity = get_irn_arity(node1);
assert(arity == get_irn_arity(node2));
for (in = 0; in < arity; ++in) {
for (int in = 0; in < arity; ++in) {
if (info1->in_reqs[in] != info2->in_reqs[in])
return false;
}
for (i = 0; i < len; ++i) {
for (size_t i = 0; i < len; ++i) {
const reg_out_info_t *out1 = &info1->out_infos[i];
const reg_out_info_t *out2 = &info2->out_infos[i];
if (out1->reg != out2->reg)
......
......@@ -49,6 +49,6 @@ void be_info_free(void);
void be_info_init_irg(ir_graph *irg);
void be_info_new_node(ir_graph *irg, ir_node *node);
int be_nodes_equal(const ir_node *node1, const ir_node *node2);
int attrs_equal_be_node(const ir_node *node1, const ir_node *node2);
#endif
......@@ -96,55 +96,35 @@ ir_op *op_be_Start;
/**
* Compare the attributes of two be_Return nodes.
*
* @return zero if both nodes have identically attributes
*/
static int Return_cmp_attr(const ir_node *a, const ir_node *b)
static int be_return_attrs_equal(const ir_node *a, const ir_node *b)
{
const be_return_attr_t *a_attr = (const be_return_attr_t*)get_irn_generic_attr_const(a);
const be_return_attr_t *b_attr = (const be_return_attr_t*)get_irn_generic_attr_const(b);
if (a_attr->num_ret_vals != b_attr->num_ret_vals)
return 1;
if (a_attr->pop != b_attr->pop)
return 1;
if (a_attr->emit_pop != b_attr->emit_pop)
return 1;
return be_nodes_equal(a, b);
const be_return_attr_t *attr_a = (const be_return_attr_t*)get_irn_generic_attr_const(a);
const be_return_attr_t *attr_b = (const be_return_attr_t*)get_irn_generic_attr_const(b);
return attr_a->num_ret_vals == attr_b->num_ret_vals
&& attr_a->pop == attr_b->pop && attr_a->emit_pop == attr_b->emit_pop
&& attrs_equal_be_node(a, b);
}
/**
* Compare the attributes of two be_IncSP nodes.
*
* @return zero if both nodes have identically attributes
*/
static int IncSP_cmp_attr(const ir_node *a, const ir_node *b)
static int be_incsp_attrs_equal(const ir_node *a, const ir_node *b)
{
const be_incsp_attr_t *a_attr = (const be_incsp_attr_t*)get_irn_generic_attr_const(a);
const be_incsp_attr_t *b_attr = (const be_incsp_attr_t*)get_irn_generic_attr_const(b);
if (a_attr->offset != b_attr->offset)
return 1;
return be_nodes_equal(a, b);
const be_incsp_attr_t *attr_a = (const be_incsp_attr_t*)get_irn_generic_attr_const(a);
const be_incsp_attr_t *attr_b = (const be_incsp_attr_t*)get_irn_generic_attr_const(b);
return attr_a->offset == attr_b->offset && attrs_equal_be_node(a, b);
}
/**
* Compare the attributes of two be_Call nodes.
*
* @return zero if both nodes have identically attributes
*/
static int Call_cmp_attr(const ir_node *a, const ir_node *b)
static int be_call_attrs_equal(const ir_node *a, const ir_node *b)
{
const be_call_attr_t *a_attr = (const be_call_attr_t*)get_irn_generic_attr_const(a);
const be_call_attr_t *b_attr = (const be_call_attr_t*)get_irn_generic_attr_const(b);
if (a_attr->ent != b_attr->ent ||
a_attr->call_tp != b_attr->call_tp)
return 1;
return be_nodes_equal(a, b);
const be_call_attr_t *attr_a = (const be_call_attr_t*)get_irn_generic_attr_const(a);
const be_call_attr_t *attr_b = (const be_call_attr_t*)get_irn_generic_attr_const(b);
return attr_a->ent == attr_b->ent && attr_a->call_tp == attr_b->call_tp
&& attrs_equal_be_node(a, b);
}
static arch_register_req_t *allocate_reg_req(ir_graph *const irg)
......@@ -1066,17 +1046,17 @@ void be_init_op(void)
ir_op_set_memory_index(op_be_Call, n_be_Call_mem);
ir_op_set_fragile_indices(op_be_Call, pn_be_Call_X_regular, pn_be_Call_X_except);
op_be_Perm->ops.node_cmp_attr = be_nodes_equal;
op_be_MemPerm->ops.node_cmp_attr = be_nodes_equal;
op_be_Copy->ops.node_cmp_attr = be_nodes_equal;
op_be_Keep->ops.node_cmp_attr = be_nodes_equal;
op_be_CopyKeep->ops.node_cmp_attr = be_nodes_equal;
op_be_Call->ops.node_cmp_attr = Call_cmp_attr;
op_be_Return->ops.node_cmp_attr = Return_cmp_attr;
op_be_AddSP->ops.node_cmp_attr = be_nodes_equal;
op_be_SubSP->ops.node_cmp_attr = be_nodes_equal;
op_be_IncSP->ops.node_cmp_attr = IncSP_cmp_attr;
op_be_Start->ops.node_cmp_attr = be_nodes_equal;
set_op_attrs_equal(op_be_Perm, attrs_equal_be_node);
set_op_attrs_equal(op_be_MemPerm, attrs_equal_be_node);
set_op_attrs_equal(op_be_Copy, attrs_equal_be_node);
set_op_attrs_equal(op_be_Keep, attrs_equal_be_node);
set_op_attrs_equal(op_be_CopyKeep, attrs_equal_be_node);
set_op_attrs_equal(op_be_Call, be_call_attrs_equal);
set_op_attrs_equal(op_be_Return, be_return_attrs_equal);
set_op_attrs_equal(op_be_AddSP, attrs_equal_be_node);
set_op_attrs_equal(op_be_SubSP, attrs_equal_be_node);
set_op_attrs_equal(op_be_IncSP, be_incsp_attrs_equal);
set_op_attrs_equal(op_be_Start, attrs_equal_be_node);
/* attach out dummy_ops to middle end nodes */
for (unsigned opc = iro_first; opc <= iro_last; ++opc) {
......
......@@ -874,122 +874,67 @@ static void init_ia32_switch_attributes(ir_node *node,
}
}
/* default compare operation to compare attributes */
static int ia32_compare_attr(const ia32_attr_t *a, const ia32_attr_t *b)
static int ia32_attrs_equal_(const ia32_attr_t *a, const ia32_attr_t *b)
{
if (a->data.tp != b->data.tp)
return 1;
if (a->data.am_scale != b->data.am_scale
|| a->am_offs != b->am_offs
|| a->am_ent != b->am_ent
|| a->data.am_sc_no_pic_adjust != b->data.am_sc_no_pic_adjust
|| a->ls_mode != b->ls_mode)
return 1;
/* nodes with not yet assigned entities shouldn't be CSEd (important for
* unsigned int -> double conversions */
if (a->data.use_frame && a->frame_ent == NULL)
return 1;