ir_entity *ent; /**< For Sel Nodes, its entity */
int intVal; /**< For Conv/Div Nodes: strict/remainderless */
unsigned uintVal;/**< for Builtin: the kind */
- ir_node *block; /**< for Block: itself */
+ ir_node *irn; /**< for nodes that never be construent: the node itself */
void *ptr; /**< generic pointer for hash/cmp */
} u;
};
}
} /* check_partition */
+/**
+ * return the result mode of a node (part of combo's opcode).
+ */
+static ir_mode *get_irn_resmode(const ir_node *irn)
+{
+ switch (get_irn_opcode(irn)) {
+ case iro_Load:
+ return get_Load_mode(irn);
+ case iro_Div:
+ return get_Div_resmode(irn);
+ case iro_Mod:
+ return get_Mod_resmode(irn);
+ default:
+ return get_irn_mode(irn);
+ }
+} /* get_irn_resmode */
+
/**
* check that all leader nodes in the partition have the same opcode.
*/
if (first) {
key.code = get_irn_opcode(irn);
- key.mode = get_irn_mode(irn);
+ key.mode = get_irn_resmode(irn);
key.arity = get_irn_arity(irn);
key.u.proj = 0;
key.u.ent = NULL;
key.u.intVal = get_Div_no_remainder(irn);
break;
case iro_Block:
- key.u.block = irn;
- break;
- case iro_Load:
- key.mode = get_Load_mode(irn);
+ case iro_ASM:
+ key.u.irn = irn;
break;
case iro_Builtin:
key.u.intVal = get_Builtin_kind(irn);
}
first = 0;
} else {
- assert((unsigned)key.code == get_irn_opcode(irn));
- assert(key.mode == get_irn_mode(irn));
+ assert((unsigned)key.code == get_irn_opcode(irn));
+ assert(key.mode == get_irn_resmode(irn));
assert(key.arity == get_irn_arity(irn));
switch (get_irn_opcode(irn)) {
assert(key.u.intVal == get_Div_no_remainder(irn));
break;
case iro_Block:
- assert(key.u.block == irn);
- break;
- case iro_Load:
- assert(key.mode == get_Load_mode(irn));
+ case iro_ASM:
+ assert(key.u.irn == irn);
break;
case iro_Builtin:
- assert(key.u.intVal == (int) get_Builtin_kind(irn));
+ assert(key.u.intVal == (int)get_Builtin_kind(irn));
break;
default:
break;
ir_node *irn = node->node;
key.code = get_irn_opcode(irn);
- key.mode = get_irn_mode(irn);
+ key.mode = get_irn_resmode(irn);
key.arity = get_irn_arity(irn);
key.u.proj = 0;
key.u.ent = NULL;
* We fix it by never letting blocks be congruent
* which cannot be detected by combo either.
*/
- key.u.block = irn;
+ key.u.irn = irn;
break;
- case iro_Load:
- key.mode = get_Load_mode(irn);
+ case iro_ASM:
+ /*
+ * If is difficult to detect when two ASM nodes are congruent: even
+ * if the assembler "text" is identical, the instruction might
+ * have a side effect like flag toggle or function call.
+ * So, do not even try it.
+ *
+ */
+ key.u.irn = irn;
break;
case iro_Builtin:
key.u.intVal = get_Builtin_kind(irn);