X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fcombo.c;h=29b210cda9c937587e4d72119a22a577b73f5f45;hb=151f1b110fe2c1ead4ae8dd66a2521f35c324946;hp=a2f8ee934e379f86cd8d012d651edeb9cfefd9a6;hpb=7ff74f4ddc0ba59d4384b289b28711f02e2a73d0;p=libfirm diff --git a/ir/opt/combo.c b/ir/opt/combo.c index a2f8ee934..29b210cda 100644 --- a/ir/opt/combo.c +++ b/ir/opt/combo.c @@ -112,6 +112,7 @@ struct opcode_key_t { 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; @@ -287,7 +288,7 @@ static void check_opcode(const partition_t *Z) { key.u.intVal = get_Conv_strict(irn); break; case iro_Div: - key.u.intVal = is_Div_remainderless(irn); + key.u.intVal = get_Div_no_remainder(irn); break; case iro_Block: key.u.block = irn; @@ -295,6 +296,9 @@ static void check_opcode(const partition_t *Z) { case iro_Load: key.mode = get_Load_mode(irn); break; + case iro_Builtin: + key.u.intVal = get_Builtin_kind(irn); + break; default: break; } @@ -315,7 +319,7 @@ static void check_opcode(const partition_t *Z) { assert(key.u.intVal == get_Conv_strict(irn)); break; case iro_Div: - assert(key.u.intVal == is_Div_remainderless(irn)); + assert(key.u.intVal == get_Div_no_remainder(irn)); break; case iro_Block: assert(key.u.block == irn); @@ -323,6 +327,9 @@ static void check_opcode(const partition_t *Z) { case iro_Load: assert(key.mode == get_Load_mode(irn)); break; + case iro_Builtin: + assert(key.u.intVal == (int) get_Builtin_kind(irn)); + break; default: break; } @@ -578,7 +585,7 @@ static int cmp_opcode(const void *elt, const void *key, size_t size) { return o1->code != o2->code || o1->mode != o2->mode || o1->arity != o2->arity || o1->u.proj != o2->u.proj || - o1->u.intVal != o2->u.intVal || + o1->u.intVal != o2->u.intVal || /* this already checks uIntVal */ o1->u.ptr != o2->u.ptr; } /* cmp_opcode */ @@ -1666,7 +1673,7 @@ static void *lambda_opcode(const node_t *node, environment_t *env) { key.u.intVal = get_Conv_strict(irn); break; case iro_Div: - key.u.intVal = is_Div_remainderless(irn); + key.u.intVal = get_Div_no_remainder(irn); break; case iro_Block: /* @@ -1680,6 +1687,9 @@ static void *lambda_opcode(const node_t *node, environment_t *env) { case iro_Load: key.mode = get_Load_mode(irn); break; + case iro_Builtin: + key.u.intVal = get_Builtin_kind(irn); + break; default: break; } @@ -2366,7 +2376,7 @@ static void compute_Proj_Cond(node_t *node, ir_node *cond) { node->type.tv = tarval_reachable; } else if (selector->type.tv == tarval_top) { if (tarval_UNKNOWN == tarval_top && - pnc == get_Cond_defaultProj(cond)) { + pnc == get_Cond_default_proj(cond)) { /* a switch based of Top is always "default" */ node->type.tv = tarval_reachable; } else { @@ -2374,7 +2384,7 @@ static void compute_Proj_Cond(node_t *node, ir_node *cond) { } } else { long value = get_tarval_long(selector->type.tv); - if (pnc == get_Cond_defaultProj(cond)) { + if (pnc == get_Cond_default_proj(cond)) { /* default switch, have to check ALL other cases */ int i; @@ -3532,6 +3542,7 @@ void combo(ir_graph *irg) { set_irg_extblk_inconsistent(irg); set_irg_doms_inconsistent(irg); set_irg_loopinfo_inconsistent(irg); + set_irg_entity_usage_state(irg, ir_entity_usage_not_computed); } ir_free_resources(irg, IR_RESOURCE_IRN_LINK | IR_RESOURCE_PHI_LIST);