long proj; /**< For Proj nodes, its proj number */
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 */
+ void *ptr; /**< generic pointer for hash/cmp */
} u;
};
case iro_Div:
key.u.intVal = is_Div_remainderless(irn);
break;
+ case iro_Block:
+ key.u.block = irn;
+ break;
+ case iro_Load:
+ key.mode = get_Load_mode(irn);
+ break;
+ case iro_Builtin:
+ key.u.intVal = get_Builtin_kind(irn);
+ break;
default:
break;
}
first = 0;
} else {
- assert(key.code == get_irn_opcode(irn));
+ assert((unsigned)key.code == get_irn_opcode(irn));
assert(key.mode == get_irn_mode(irn));
assert(key.arity == get_irn_arity(irn));
case iro_Div:
assert(key.u.intVal == is_Div_remainderless(irn));
break;
+ case iro_Block:
+ assert(key.u.block == irn);
+ break;
+ case iro_Load:
+ assert(key.mode == get_Load_mode(irn));
+ break;
+ case iro_Builtin:
+ assert(key.u.intVal == get_Builtin_kind(irn));
+ break;
default:
break;
}
* @return a hash value for the given opcode map entry
*/
static unsigned opcode_hash(const opcode_key_t *entry) {
- return (entry->mode - (ir_mode *)0) * 9 + entry->code + entry->u.proj * 3 + HASH_PTR(entry->u.ent) + entry->arity;
+ return (entry->mode - (ir_mode *)0) * 9 + entry->code + entry->u.proj * 3 + HASH_PTR(entry->u.ptr) + entry->arity;
} /* opcode_hash */
/**
(void) size;
return o1->code != o2->code || o1->mode != o2->mode ||
o1->arity != o2->arity ||
- o1->u.proj != o2->u.proj || o1->u.ent != o2->u.ent ||
- o1->u.intVal != o2->u.intVal;
+ o1->u.proj != o2->u.proj ||
+ o1->u.intVal != o2->u.intVal || /* this already checks uIntVal */
+ o1->u.ptr != o2->u.ptr;
} /* cmp_opcode */
/**
case iro_Div:
key.u.intVal = is_Div_remainderless(irn);
break;
+ case iro_Block:
+ /*
+ * Some ugliness here: Two Blocks having the same
+ * IJmp predecessor would be congruent, which of course is wrong.
+ * We fix it by never letting blocks be congruent
+ * which cannot be detected by combo either.
+ */
+ key.u.block = irn;
+ break;
+ case iro_Load:
+ key.mode = get_Load_mode(irn);
+ break;
+ case iro_Builtin:
+ key.u.intVal = get_Builtin_kind(irn);
+ break;
default:
break;
}
pred = i == -1 ? get_irn_n(skipped, i) : get_irn_n(node->node, i);
p = get_irn_node(pred);
-
return p->part;
} /* lambda_partition */