diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-01 16:23:52 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-01 16:23:52 +0000 |
commit | 77de7381a79795a3426328ad275f0f82a991f5bf (patch) | |
tree | 705fb39524c1af4fc7251567df4f88f848dd5e99 /gcc/tree-ssa-coalesce.c | |
parent | 8f6fa493f6996ec343ead1770530605326197ff9 (diff) | |
download | gcc-77de7381a79795a3426328ad275f0f82a991f5bf.tar.gz |
* tree-ssa-live.h (coalesce_ssa_name): Move Prototype to...
* tree-ssa-coalesce.h: New. Move prototype to here.
* tree-outof-ssa.h: Include tree-ssa-coalesce.h.
* tree-ssa-coalesce.c: Include tree-outof-ssa.h.
(gimple_can_coalesce_p): Move to...
* gimple.c (gimple_can_coalesce_p): Here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203069 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-coalesce.c')
-rw-r--r-- | gcc/tree-ssa-coalesce.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c index 087272fe13a..2f5507ca8fc 100644 --- a/gcc/tree-ssa-coalesce.c +++ b/gcc/tree-ssa-coalesce.c @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "dumpfile.h" #include "tree-ssa.h" #include "hash-table.h" -#include "tree-ssa-live.h" +#include "tree-outof-ssa.h" #include "diagnostic-core.h" @@ -1333,42 +1333,3 @@ coalesce_ssa_name (void) return map; } - -/* Given SSA_NAMEs NAME1 and NAME2, return true if they are candidates for - coalescing together, false otherwise. - - This must stay consistent with var_map_base_init in tree-ssa-live.c. */ - -bool -gimple_can_coalesce_p (tree name1, tree name2) -{ - /* First check the SSA_NAME's associated DECL. We only want to - coalesce if they have the same DECL or both have no associated DECL. */ - tree var1 = SSA_NAME_VAR (name1); - tree var2 = SSA_NAME_VAR (name2); - var1 = (var1 && (!VAR_P (var1) || !DECL_IGNORED_P (var1))) ? var1 : NULL_TREE; - var2 = (var2 && (!VAR_P (var2) || !DECL_IGNORED_P (var2))) ? var2 : NULL_TREE; - if (var1 != var2) - return false; - - /* Now check the types. If the types are the same, then we should - try to coalesce V1 and V2. */ - tree t1 = TREE_TYPE (name1); - tree t2 = TREE_TYPE (name2); - if (t1 == t2) - return true; - - /* If the types are not the same, check for a canonical type match. This - (for example) allows coalescing when the types are fundamentally the - same, but just have different names. - - Note pointer types with different address spaces may have the same - canonical type. Those are rejected for coalescing by the - types_compatible_p check. */ - if (TYPE_CANONICAL (t1) - && TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2) - && types_compatible_p (t1, t2)) - return true; - - return false; -} |