From fa62db42b99e9eb1c067d2171bc437b3394e4d5d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 3 Nov 2021 15:01:44 +0100 Subject: VN/PRE TLC This removes an always true parameter of vn_nary_op_insert_into and moves valueization to the two callers of vn_nary_op_compute_hash instead of doing it therein where this function name does not suggest such thing. Also remove extra valueization from PRE phi-translation. 2021-11-03 Richard Biener * tree-ssa-sccvn.c (vn_nary_op_insert_into): Remove always true parameter and inline valueization. (vn_nary_op_lookup_1): Inline valueization from ... (vn_nary_op_compute_hash): ... here and remove it here. * tree-ssa-pre.c (phi_translate_1): Do not valueize before vn_nary_lookup_pieces. (get_representative_for): Mark created SSA representatives as visited. --- gcc/tree-ssa-pre.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gcc/tree-ssa-pre.c') diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index dc55d86..0669aaa 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1391,6 +1391,7 @@ get_representative_for (const pre_expr e, basic_block b = NULL) vn_ssa_aux_t vn_info = VN_INFO (name); vn_info->value_id = value_id; vn_info->valnum = valnum ? valnum : name; + vn_info->visited = true; /* ??? For now mark this SSA name for release by VN. */ vn_info->needs_insertion = true; add_to_value (value_id, get_or_alloc_expr_for_name (name)); @@ -1508,10 +1509,6 @@ phi_translate_1 (bitmap_set_t dest, return constant; } - /* vn_nary_* do not valueize operands. */ - for (i = 0; i < newnary->length; ++i) - if (TREE_CODE (newnary->op[i]) == SSA_NAME) - newnary->op[i] = VN_INFO (newnary->op[i])->valnum; tree result = vn_nary_op_lookup_pieces (newnary->length, newnary->opcode, newnary->type, -- cgit v1.1