aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-copyrename.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2012-06-13 20:41:41 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2012-06-13 20:41:41 +0000
commit21d01365ab8d0e16c681352cc0cc0e7ab726dc03 (patch)
tree126009dcd8222ffd4b61e63e72cc8fdf8cef55da /gcc/tree-ssa-copyrename.c
parentb78fd1642a52a841780204061dbf23827cbca334 (diff)
downloadgcc-21d01365ab8d0e16c681352cc0cc0e7ab726dc03.zip
gcc-21d01365ab8d0e16c681352cc0cc0e7ab726dc03.tar.gz
gcc-21d01365ab8d0e16c681352cc0cc0e7ab726dc03.tar.bz2
common.opt (ftree-coalesce-inlined-vars): New.
gcc/ChangeLog: * common.opt (ftree-coalesce-inlined-vars): New. (ftree-coalesce-vars): New. * doc/invoke.texi: Document them. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Implement them. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/ivopts-2.C: Adjust for coalescing. * gcc.dg/tree-ssa/forwprop-11.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. From-SVN: r188526
Diffstat (limited to 'gcc/tree-ssa-copyrename.c')
-rw-r--r--gcc/tree-ssa-copyrename.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c
index 3e01b6e..6ee8380 100644
--- a/gcc/tree-ssa-copyrename.c
+++ b/gcc/tree-ssa-copyrename.c
@@ -194,20 +194,21 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
ign1 = TREE_CODE (root1) == VAR_DECL && DECL_IGNORED_P (root1);
ign2 = TREE_CODE (root2) == VAR_DECL && DECL_IGNORED_P (root2);
- /* Never attempt to coalesce 2 user variables unless one is an inline
- variable. */
+ /* Refrain from coalescing user variables, if requested. */
if (!ign1 && !ign2)
{
- if (DECL_FROM_INLINE (root2))
- ign2 = true;
- else if (DECL_FROM_INLINE (root1))
+ if (flag_ssa_coalesce_vars && DECL_FROM_INLINE (root2))
+ ign2 = true;
+ else if (flag_ssa_coalesce_vars && DECL_FROM_INLINE (root1))
ign1 = true;
- else
+ else if (flag_ssa_coalesce_vars != 2)
{
if (debug)
fprintf (debug, " : 2 different USER vars. No coalesce.\n");
return false;
}
+ else
+ ign2 = true;
}
/* If both values have default defs, we can't coalesce. If only one has a