Commit 012309e6 by Daniel Berlin Committed by Daniel Berlin

tree-ssa-reassoc.o: New.


2005-06-06  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-reassoc.o: New.
	(OBJS-common): Add tree-ssa-reassoc.o
	* timevar.def: Add TV_TREE_REASSOC
	* tree-optimize.c (pass_reassoc): Add call.
	* tree-pass.h (pass_reassoc): Add.
	* tree-ssa-reassoc.c: New file.

From-SVN: r100671
parent 08fd6d04
2005-06-06 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-reassoc.o: New.
(OBJS-common): Add tree-ssa-reassoc.o
* timevar.def: Add TV_TREE_REASSOC
* tree-optimize.c (pass_reassoc): Add call.
* tree-pass.h (pass_reassoc): Add.
* tree-ssa-reassoc.c: New file.
2005-06-06 Eric Christopher <echristo@redhat.com>
target/21927
......
......@@ -962,7 +962,8 @@ OBJS-common = \
et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o passes.o \
rtl-profile.o tree-profile.o rtlhooks.o cfgexpand.o lambda-mat.o \
lambda-trans.o lambda-code.o tree-loop-linear.o tree-ssa-sink.o \
tree-vrp.o tree-stdarg.o tree-cfgcleanup.o
tree-vrp.o tree-stdarg.o tree-cfgcleanup.o tree-ssa-reassoc.o
OBJS-md = $(out_object_file)
OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o \
......@@ -1736,8 +1737,8 @@ tree-ssa-copyrename.o : tree-ssa-copyrename.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-ssa-pre.o : tree-ssa-pre.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \
alloc-pool.h $(BASIC_BLOCK_H) bitmap.h $(FIBHEAP_H) $(HASHTAB_H) \
langhooks.h real.h $(TREE_GIMPLE_H) tree-inline.h tree-iterator.h
alloc-pool.h $(BASIC_BLOCK_H) bitmap.h $(HASHTAB_H) $(TREE_GIMPLE_H) \
tree-inline.h tree-iterator.h
tree-vn.o : tree-vn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \
$(TREE_H) $(TREE_FLOW_H) $(HASHTAB_H) langhooks.h tree-pass.h \
$(TREE_DUMP_H) $(DIAGNOSTIC_H)
......@@ -1836,6 +1837,10 @@ tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
function.h $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h \
$(TREE_DUMP_H) tree-pass.h $(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
hard-reg-set.h $(TREE_GIMPLE_H) vec.h
tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TIMEVAR_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) tree-iterator.h\
$(BASIC_BLOCK_H) $(HASHTAB_H) $(TREE_GIMPLE_H) tree-inline.h
tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \
$(FLAGS_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) toplev.h \
......
......@@ -31,5 +31,5 @@ int xxx (void)
Calls to cst_fun2 and pure_fun2 should not be, since calling
with k = 0 may be invalid. */
/* { dg-final { scan-tree-dump-times "Moving statement" 2 "lim" } } */
/* { dg-final { scan-tree-dump-times "Moving statement" 3 "lim" } } */
/* { dg-final { cleanup-tree-dump "lim" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */
int a, b, c, d;
extern int printf (const char *, ...);
int main(void)
{
int e;
int f;
/* We should be able to transform these into the same expression, and only have two additions. */
e = a + b;
e = e + c;
f = c + a;
f = f + b;
printf ("%d %d\n", e, f);
}
/* { dg-final { scan-tree-dump-times "a \\\+ b" 1 "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-reassoc-details" } */
extern int a0, a1, a2, a3, a4;
int f ()
{
int b0, b1, b2, b3, b4;
/* this can be optimized to four additions... */
b4 = a4 + a3 + a2 + a1 + a0;
b3 = a3 + a2 + a1 + a0;
b2 = a2 + a1 + a0;
b1 = a1 + a0;
/* This is actually 0 */
return b4 - b3 + b2 - b1 - a4 - a2;
}
/* { dg-final { scan-tree-dump-times "Reassociating by rank" 3 "reassoc" } } */
/* { dg-final { scan-tree-dump-times "return 0" 1 "optimized" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
/* { dg-final { cleanup-tree-dump "reassoc" } } */
......@@ -82,6 +82,7 @@ DEFTIMEVAR (TV_TREE_SRA , "tree SRA")
DEFTIMEVAR (TV_TREE_STORE_CCP , "tree STORE-CCP")
DEFTIMEVAR (TV_TREE_CCP , "tree CCP")
DEFTIMEVAR (TV_TREE_SPLIT_EDGES , "tree split crit edges")
DEFTIMEVAR (TV_TREE_REASSOC , "tree reassociation")
DEFTIMEVAR (TV_TREE_PRE , "tree PRE")
DEFTIMEVAR (TV_TREE_REDPHI , "tree redundant PHIs")
DEFTIMEVAR (TV_TREE_FRE , "tree FRE")
......
......@@ -439,6 +439,7 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_may_alias);
NEXT_PASS (pass_cse_reciprocals);
NEXT_PASS (pass_split_crit_edges);
NEXT_PASS (pass_reassoc);
NEXT_PASS (pass_pre);
NEXT_PASS (pass_sink_code);
NEXT_PASS (pass_loop);
......
......@@ -221,7 +221,9 @@ extern struct tree_opt_pass pass_store_copy_prop;
extern struct tree_opt_pass pass_vrp;
extern struct tree_opt_pass pass_create_structure_vars;
extern struct tree_opt_pass pass_uncprop;
extern struct tree_opt_pass pass_reassoc;
/* IPA Passes */
extern struct tree_opt_pass pass_ipa_inline;
#endif /* GCC_TREE_PASS_H */
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