diff options
author | Richard Biener <rguenther@suse.de> | 2012-12-13 09:32:56 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-12-13 09:32:56 +0000 |
commit | a044f0e7916bbae7ac17d7079e9aee6cfaf5cf08 (patch) | |
tree | 97aaa0a3e5fbe8a40a828bb5d0d7fb273424208f /gcc | |
parent | 653787d7878ff932aeae23f99d104955ca1b8581 (diff) | |
download | gcc-a044f0e7916bbae7ac17d7079e9aee6cfaf5cf08.zip gcc-a044f0e7916bbae7ac17d7079e9aee6cfaf5cf08.tar.gz gcc-a044f0e7916bbae7ac17d7079e9aee6cfaf5cf08.tar.bz2 |
tree-ssa-pre.c (get_representative_for): Adjust dumping.
2012-12-13 Richard Biener <rguenther@suse.de>
* tree-ssa-pre.c (get_representative_for): Adjust dumping.
Mark created SSA names for release.
(eliminate_bb): Insert only when expr is not NULL.
From-SVN: r194468
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 28 |
2 files changed, 18 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bb26702..8f027e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-12-13 Richard Biener <rguenther@suse.de> + + * tree-ssa-pre.c (get_representative_for): Adjust dumping. + Mark created SSA names for release. + (eliminate_bb): Insert only when expr is not NULL. + 2012-12-12 Jakub Jelinek <jakub@redhat.com> PR debug/55665 diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 689d170..17877ba 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1395,31 +1395,26 @@ get_representative_for (const pre_expr e) pre_expr rep = expression_for_id (i); if (rep->kind == NAME) return PRE_EXPR_NAME (rep); + else if (rep->kind == CONSTANT) + return PRE_EXPR_CONSTANT (rep); } } break; } + /* If we reached here we couldn't find an SSA_NAME. This can happen when we've discovered a value that has never appeared in - the program as set to an SSA_NAME, most likely as the result of - phi translation. */ - if (dump_file) - { - fprintf (dump_file, - "Could not find SSA_NAME representative for expression:"); - print_pre_expr (dump_file, e); - fprintf (dump_file, "\n"); - } - - /* Build and insert the assignment of the end result to the temporary - that we will return. */ + the program as set to an SSA_NAME, as the result of phi translation. + Create one here. + ??? We should be able to re-use this when we insert the statement + to compute it. */ name = make_temp_ssa_name (get_expr_type (e), gimple_build_nop (), "pretmp"); VN_INFO_GET (name)->value_id = value_id; - VN_INFO (name)->valnum = sccvn_valnum_from_value_id (value_id); - if (VN_INFO (name)->valnum == NULL_TREE) - VN_INFO (name)->valnum = name; + VN_INFO (name)->valnum = name; + /* ??? For now mark this SSA name for release by SCCVN. */ + VN_INFO (name)->needs_insertion = true; add_to_value (value_id, get_or_alloc_expr_for_name (name)); - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "Created SSA_NAME representative "); print_generic_expr (dump_file, name, 0); @@ -4170,6 +4165,7 @@ eliminate_bb (dom_walk_data *, basic_block b) if (val != VN_TOP && TREE_CODE (val) == SSA_NAME && VN_INFO (val)->needs_insertion + && VN_INFO (val)->expr != NULL_TREE && (sprime = eliminate_insert (&gsi, val)) != NULL_TREE) eliminate_push_avail (sprime); } |