Commit b71b4522 by Daniel Berlin Committed by Daniel Berlin

Revert (note the sccvn portions are *not* reverted) 2007-07-06 Daniel Berlin <dberlin@dberlin.org>

2007-07-07  Daniel Berlin  <dberlin@dberlin.org>

	Revert (note the sccvn portions are *not* reverted)
	2007-07-06  Daniel Berlin  <dberlin@dberlin.org>

	Fix PR tree-optimization/23488

	* tree-vn.c (set_value_handle): Use decl_vh_map for decl value
	handles.
	* tree-flow-inline.h (get_value_handle): Ditto.
	* tree-ssa-pre.c (decl_vh_map): New.
	(decl_node_pool): New.
	(can_value_number_operation): Support DECL_P.
	(can_PRE_operation): Ditto.
	(create_expression_by_pieces): Ditto.
	(find_existing_value_expr): Modify to differnetiate between
	addressing and top level.
	(create_value_handle_for_expr): Handle DECL's.
	(poolify_tree): Ditto.
	(make_values_for_phi): Don't insert into PHI_GEN during FRE.
	(make_values_for_stmt): Handle DECL's properly.
	(init_pre): Reorg to not init useless things during FRE.
	(fini_pre): Ditto.
	* tree-flow.h: Include pointer-set.h.
	(decl_vh_map): Declare.
	* Makefile.in (TREE_FLOW_H): Add pointer-set.h

From-SVN: r126449
parent 0e8eb4d8
2007-07-07 Daniel Berlin <dberlin@dberlin.org>
Revert (note the sccvn portions are *not* reverted)
2007-07-06 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/23488
* tree-vn.c (set_value_handle): Use decl_vh_map for decl value
handles.
* tree-flow-inline.h (get_value_handle): Ditto.
* tree-ssa-pre.c (decl_vh_map): New.
(decl_node_pool): New.
(can_value_number_operation): Support DECL_P.
(can_PRE_operation): Ditto.
(create_expression_by_pieces): Ditto.
(find_existing_value_expr): Modify to differnetiate between
addressing and top level.
(create_value_handle_for_expr): Handle DECL's.
(poolify_tree): Ditto.
(make_values_for_phi): Don't insert into PHI_GEN during FRE.
(make_values_for_stmt): Handle DECL's properly.
(init_pre): Reorg to not init useless things during FRE.
(fini_pre): Ditto.
* tree-flow.h: Include pointer-set.h.
(decl_vh_map): Declare.
* Makefile.in (TREE_FLOW_H): Add pointer-set.h
2007-07-07 Eric Weddington <eweddington@cso.atmel.com>
* config/avr/constraints.md (define_memory_constraint "Q"): Fix
......
......@@ -805,7 +805,7 @@ TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H)
TREE_GIMPLE_H = tree-gimple.h tree-iterator.h
TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h $(TREE_GIMPLE_H) \
$(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) pointer-set.h
$(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H)
TREE_SSA_LIVE_H = tree-ssa-live.h $(PARTITION_H) vecprim.h
PRETTY_PRINT_H = pretty-print.h input.h $(OBSTACK_H)
DIAGNOSTIC_H = diagnostic.h diagnostic.def $(PRETTY_PRINT_H) options.h
......
2007-07-07 Daniel Berlin <dberlin@dberlin.org>
* Revert add of gcc.dg/tree-ssa/ssa-pre-17.c.
2007-07-07 Mark Mitchell <mark@codesourcery.com>
PR c++/32232
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre-details" } */
int i;
int foo(int q) {
int j;
int p;
for (j = 0; j < 9; j++)
{
p = i + q;
}
return p;
}
/* We should replace p = a load from i that will pop into the loop, with a hoisted version.
We should also replace i + q with a hoisted version. */
/* { dg-final { scan-tree-dump-times "Replaced " 2 "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
......@@ -1792,20 +1792,12 @@ get_value_handle (tree expr)
{
if (TREE_CODE (expr) == SSA_NAME)
return SSA_NAME_VALUE (expr);
else if (TREE_CODE (expr) == TREE_LIST
else if (DECL_P (expr) || TREE_CODE (expr) == TREE_LIST
|| TREE_CODE (expr) == CONSTRUCTOR)
{
tree_ann_common_t ann = tree_common_ann (expr);
return ((ann) ? ann->value_handle : NULL_TREE);
}
else if (DECL_P (expr))
{
tree *result = (tree *)pointer_map_contains (decl_vh_map,
expr);
if (result)
return *result;
return NULL_TREE;
}
else if (is_gimple_min_invariant (expr))
return expr;
else if (EXPR_P (expr))
......
......@@ -31,7 +31,6 @@ Boston, MA 02110-1301, USA. */
#include "tree-ssa-operands.h"
#include "cgraph.h"
#include "ipa-reference.h"
#include "pointer-set.h"
/* Forward declare structures for the garbage collector GTY markers. */
#ifndef GCC_BASIC_BLOCK_H
......@@ -1082,7 +1081,7 @@ extern bool maybe_clean_or_replace_eh_stmt (tree, tree);
void add_to_value (tree, tree);
void debug_value_expressions (tree);
void print_value_expressions (FILE *, tree);
extern struct pointer_map_t *decl_vh_map;
/* In tree-vn.c */
tree make_value_handle (tree);
......
......@@ -83,10 +83,6 @@ expressions_equal_p (tree e1, tree e2)
return true;
}
else if (TREE_CODE (e1) == TREE_CODE (e2)
&& DECL_P (e1)
&& te1 == te2)
return DECL_UID (e1) == DECL_UID (e2);
else if (TREE_CODE (e1) == TREE_CODE (e2)
&& (te1 == te2
|| types_compatible_p (te1, te2))
......@@ -103,12 +99,7 @@ set_value_handle (tree e, tree v)
{
if (TREE_CODE (e) == SSA_NAME)
SSA_NAME_VALUE (e) = v;
else if (DECL_P (e))
{
tree *slot = (tree *)pointer_map_insert (decl_vh_map, e);
*slot = v;
}
else if (EXPR_P (e) || TREE_CODE (e) == TREE_LIST
else if (EXPR_P (e) || DECL_P (e) || TREE_CODE (e) == TREE_LIST
|| GIMPLE_STMT_P (e)
|| TREE_CODE (e) == CONSTRUCTOR)
get_tree_common_ann (e)->value_handle = v;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment