Commit 85300b46 by Daniel Berlin Committed by Daniel Berlin

tree-ssa-pre.c (bb_value_sets_t): Add antic_safe_loads.

2006-02-06  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-pre.c (bb_value_sets_t): Add antic_safe_loads.
	(ANTIC_SAFE_LOADS): New macro.
	(find_or_generate_expression): Add prototype.
	(set_contains_value): Allow null set for sake of not always having
	to allocate ANTIC_SAFE_LOADS.
	(phi_translate): Move placement of AGGREGATE_TYPE_P check.
	Allow COMPONENT_REF too.
	(valid_in_set): Allow COMPONENT_REF.
	Check ANTIC_SAFE_LOADS too.
	(compute_antic_aux): Print out ANTIC_SAFE_LOADS.
	(compute_rvuse_and_antic_safe): Add ANTIC_SAFE computation, and
	rename.
	(can_PRE_operation): Add COMPONENT_REF.
	(create_component_ref_by_pieces): New function.
	(create_expression_by_pieces): Use create_component_ref_by_pieces.
	(insert_aux): Move AGGREGATE_TYPE_P check here.
	(compute_avail): Set bb local stmt uids.
	(pass_pre): Use TODO_update_ssa_only_virtuals.

2006-02-06  Daniel Berlin  <dberlin@dberlin.org>

	* gcc.dg/tree-ssa/loadpre10.c: New test.
	* gcc.dg/tree-ssa/loadpre11.c: Ditto.
	* gcc.dg/tree-ssa/loadpre6.c: Expect one more elimination.
	* gcc.dg/tree-ssa/loadpre4.c: This should pass now.

From-SVN: r110644
parent 8a46b94f
2006-02-06 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-pre.c (bb_value_sets_t): Add antic_safe_loads.
(ANTIC_SAFE_LOADS): New macro.
(find_or_generate_expression): Add prototype.
(set_contains_value): Allow null set for sake of not always having
to allocate ANTIC_SAFE_LOADS.
(phi_translate): Move placement of AGGREGATE_TYPE_P check.
Allow COMPONENT_REF too.
(valid_in_set): Allow COMPONENT_REF.
Check ANTIC_SAFE_LOADS too.
(compute_antic_aux): Print out ANTIC_SAFE_LOADS.
(compute_rvuse_and_antic_safe): Add ANTIC_SAFE computation, and
rename.
(can_PRE_operation): Add COMPONENT_REF.
(create_component_ref_by_pieces): New function.
(create_expression_by_pieces): Use create_component_ref_by_pieces.
(insert_aux): Move AGGREGATE_TYPE_P check here.
(compute_avail): Set bb local stmt uids.
(pass_pre): Use TODO_update_ssa_only_virtuals.
2006-02-06 Ben Elliston <bje@au.ibm.com>
* configure.ac: Unconditionally disable decimal float by default.
......
2006-02-06 Daniel Berlin <dberlin@dberlin.org>
* gcc.dg/tree-ssa/loadpre10.c: New test.
* gcc.dg/tree-ssa/loadpre11.c: Ditto.
* gcc.dg/tree-ssa/loadpre6.c: Expect one more elimination.
* gcc.dg/tree-ssa/loadpre4.c: This should pass now.
2006-02-06 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/24685
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre-stats" } */
struct tree_common
{
int code;
};
union tree_node
{
struct tree_common common;
};
typedef union tree_node *tree;
extern tree test (tree, int, int);
extern tree foo (void);
extern void abort (void) __attribute__ ((__noreturn__));
/* Redundant loads of expr->common.code */
tree
test (tree expr, int t, int D17630)
{
int __i;
L0:
if (expr->common.code != 142) goto L23; else goto L2;
L2:
__i = 0;
goto L10;
L10:
__i = __i + 1;
if (D17630 != __i) goto L8; else goto L19;
L8:
if (t) goto L15; else goto L10;
L15:
expr = foo ();
if (expr->common.code != 142) goto L23; else goto L0;
L19:
abort ();
L23:
return expr;
}
/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre-stats" } */
int *t;
int g(int);
int f(int tt)
{
int *t1 = t;
if (*t1)
*t1 = 2;
return g(*t1);
}
/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */
......@@ -7,8 +7,6 @@ int main(int *a, int argc)
int i;
int d, e;
/* With smarter load PRE, we'd be able to recompute the value at the
kill point. arguably not worth it. */
for (i = 0; i < argc; i++)
{
e = *a;
......@@ -17,5 +15,5 @@ int main(int *a, int argc)
return d + e;
}
/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
......@@ -30,6 +30,8 @@ foo (void)
abort ();
}
/* There are some reloaded loads of *cell, and cell->common.chain on various
branches. */
void __attribute__((noinline))
remove_useless_vars (tree *unexpanded_var_list, int dump_file)
{
......@@ -69,6 +71,6 @@ main (void)
remove_useless_vars (&unexpanded_var_list, 0);
return 0;
}
/* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre" } } */
/* { dg-final { scan-tree-dump-times "Eliminated: 2" 1 "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
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