static unsigned int vn_nary_length_from_stmt (gimple *);
static vn_nary_op_t alloc_vn_nary_op_noinit (unsigned int, obstack *);
static vn_nary_op_t vn_nary_op_insert_into (vn_nary_op_t,
- vn_nary_op_table_type *, bool);
+ vn_nary_op_table_type *);
static void init_vn_nary_op_from_stmt (vn_nary_op_t, gassign *);
static void init_vn_nary_op_from_pieces (vn_nary_op_t, unsigned int,
enum tree_code, tree, tree *);
boolean_type_node, ops);
nary->predicated_values = 0;
nary->u.result = boolean_true_node;
- vn_nary_op_insert_into (nary, valid_info->nary, true);
+ vn_nary_op_insert_into (nary, valid_info->nary);
gcc_assert (nary->unwind_to == NULL);
/* Also do not link it into the undo chain. */
last_inserted_nary = nary->next;
boolean_type_node, ops);
nary->predicated_values = 0;
nary->u.result = boolean_false_node;
- vn_nary_op_insert_into (nary, valid_info->nary, true);
+ vn_nary_op_insert_into (nary, valid_info->nary);
gcc_assert (nary->unwind_to == NULL);
last_inserted_nary = nary->next;
nary->next = (vn_nary_op_t)(void *)-1;
vno1->predicated_values = 0;
vno1->u.result = result;
init_vn_nary_op_from_stmt (vno1, as_a <gassign *> (new_stmt));
- vn_nary_op_insert_into (vno1, valid_info->nary, true);
+ vn_nary_op_insert_into (vno1, valid_info->nary);
/* Also do not link it into the undo chain. */
last_inserted_nary = vno1->next;
vno1->next = (vn_nary_op_t)(void *)-1;
inchash::hash hstate;
unsigned i;
- for (i = 0; i < vno1->length; ++i)
- if (TREE_CODE (vno1->op[i]) == SSA_NAME)
- vno1->op[i] = SSA_VAL (vno1->op[i]);
-
if (((vno1->length == 2
&& commutative_tree_code (vno1->opcode))
|| (vno1->length == 3
if (vnresult)
*vnresult = NULL;
+ for (unsigned i = 0; i < vno->length; ++i)
+ if (TREE_CODE (vno->op[i]) == SSA_NAME)
+ vno->op[i] = SSA_VAL (vno->op[i]);
+
vno->hashcode = vn_nary_op_compute_hash (vno);
slot = valid_info->nary->find_slot_with_hash (vno, vno->hashcode, NO_INSERT);
if (!slot)
return vno1;
}
-/* Insert VNO into TABLE. If COMPUTE_HASH is true, then compute
- VNO->HASHCODE first. */
+/* Insert VNO into TABLE. */
static vn_nary_op_t
-vn_nary_op_insert_into (vn_nary_op_t vno, vn_nary_op_table_type *table,
- bool compute_hash)
+vn_nary_op_insert_into (vn_nary_op_t vno, vn_nary_op_table_type *table)
{
vn_nary_op_s **slot;
- if (compute_hash)
- {
- vno->hashcode = vn_nary_op_compute_hash (vno);
- gcc_assert (! vno->predicated_values
- || (! vno->u.values->next
- && vno->u.values->n == 1));
- }
+ gcc_assert (! vno->predicated_values
+ || (! vno->u.values->next
+ && vno->u.values->n == 1));
+
+ for (unsigned i = 0; i < vno->length; ++i)
+ if (TREE_CODE (vno->op[i]) == SSA_NAME)
+ vno->op[i] = SSA_VAL (vno->op[i]);
+ vno->hashcode = vn_nary_op_compute_hash (vno);
slot = table->find_slot_with_hash (vno, vno->hashcode, INSERT);
vno->unwind_to = *slot;
if (*slot)
{
vn_nary_op_t vno1 = alloc_vn_nary_op (length, result, value_id);
init_vn_nary_op_from_pieces (vno1, length, code, type, ops);
- return vn_nary_op_insert_into (vno1, valid_info->nary, true);
+ return vn_nary_op_insert_into (vno1, valid_info->nary);
}
static vn_nary_op_t
vno1->u.values->result = result;
vno1->u.values->n = 1;
vno1->u.values->valid_dominated_by_p[0] = pred_e->dest->index;
- return vn_nary_op_insert_into (vno1, valid_info->nary, true);
+ return vn_nary_op_insert_into (vno1, valid_info->nary);
}
static bool
= alloc_vn_nary_op (vn_nary_length_from_stmt (stmt),
result, VN_INFO (result)->value_id);
init_vn_nary_op_from_stmt (vno1, as_a <gassign *> (stmt));
- return vn_nary_op_insert_into (vno1, valid_info->nary, true);
+ return vn_nary_op_insert_into (vno1, valid_info->nary);
}
/* Compute a hashcode for PHI operation VP1 and return it. */