Commit 204b560f by Sebastian Pop Committed by Sebastian Pop

New implementation of Graphite.

2009-07-30  Sebastian Pop  <sebastian.pop@amd.com>

	* Makefile.in (OBJS-common): Added dependence on graphite-blocking.o,
	graphite-clast-to-gimple.o, graphite-dependences.o,
	graphite-interchange.o, graphite-poly.o, graphite-ppl.o,
	graphite-scop-detection.o, graphite-sese-to-poly.o, and sese.o.
	(graphite-blocking.o,
	graphite-clast-to-gimple.o, graphite-dependences.o,
	graphite-interchange.o, graphite-poly.o, graphite-ppl.o,
	graphite-scop-detection.o, graphite-sese-to-poly.o, and sese.o): New.
	* cfgloop.c (alloc_loop): Set loop->can_be_parallel to false.
	* cfgloop.h (struct loop): Add can_be_parallel field.
	* common.opt (fgraphite-identity): Moved up.
	(fgraphite-force-parallel): New flag.
	* graphite.c: Rewrite.
	* graphite.h: Rewrite.
	* passes.c (init_optimization_passes): Schedule a pass of DCE and LIM
	after Graphite.
	* toplev.c (graphite_out_file): New file descriptor.
	(graphite_in_file): New.
	(process_options): flag_graphite_force_parallel cannot be used without
	Graphite.
	* tree-ssa-loop.c: Include toplev.h.
	(gate_graphite_transforms): Enable flag_graphite for
	flag_graphite_force_parallel.

From-SVN: r150301
parent 2abae5f1
2009-07-30 Sebastian Pop <sebastian.pop@amd.com> 2009-07-30 Sebastian Pop <sebastian.pop@amd.com>
* Makefile.in (OBJS-common): Added dependence on graphite-blocking.o,
graphite-clast-to-gimple.o, graphite-dependences.o,
graphite-interchange.o, graphite-poly.o, graphite-ppl.o,
graphite-scop-detection.o, graphite-sese-to-poly.o, and sese.o.
(graphite-blocking.o,
graphite-clast-to-gimple.o, graphite-dependences.o,
graphite-interchange.o, graphite-poly.o, graphite-ppl.o,
graphite-scop-detection.o, graphite-sese-to-poly.o, and sese.o): New.
* cfgloop.c (alloc_loop): Set loop->can_be_parallel to false.
* cfgloop.h (struct loop): Add can_be_parallel field.
* common.opt (fgraphite-identity): Moved up.
(fgraphite-force-parallel): New flag.
* graphite.c: Rewrite.
* graphite.h: Rewrite.
* passes.c (init_optimization_passes): Schedule a pass of DCE and LIM
after Graphite.
* toplev.c (graphite_out_file): New file descriptor.
(graphite_in_file): New.
(process_options): flag_graphite_force_parallel cannot be used without
Graphite.
* tree-ssa-loop.c: Include toplev.h.
(gate_graphite_transforms): Enable flag_graphite for
flag_graphite_force_parallel.
2009-07-30 Sebastian Pop <sebastian.pop@amd.com>
* ChangeLog.graphite: New. * ChangeLog.graphite: New.
* graphite-blocking.c: New. * graphite-blocking.c: New.
* graphite-clast-to-gimple.c: New. * graphite-clast-to-gimple.c: New.
......
...@@ -1178,6 +1178,14 @@ OBJS-common = \ ...@@ -1178,6 +1178,14 @@ OBJS-common = \
graph.o \ graph.o \
graphds.o \ graphds.o \
graphite.o \ graphite.o \
graphite-blocking.o \
graphite-clast-to-gimple.o \
graphite-dependences.o \
graphite-interchange.o \
graphite-poly.o \
graphite-ppl.o \
graphite-scop-detection.o \
graphite-sese-to-poly.o \
gtype-desc.o \ gtype-desc.o \
haifa-sched.o \ haifa-sched.o \
hooks.o \ hooks.o \
...@@ -1251,6 +1259,7 @@ OBJS-common = \ ...@@ -1251,6 +1259,7 @@ OBJS-common = \
sel-sched-ir.o \ sel-sched-ir.o \
sel-sched-dump.o \ sel-sched-dump.o \
sel-sched.o \ sel-sched.o \
sese.o \
simplify-rtx.o \ simplify-rtx.o \
sparseset.o \ sparseset.o \
sreal.o \ sreal.o \
...@@ -2450,11 +2459,64 @@ tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ ...@@ -2450,11 +2459,64 @@ tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(TREE_DATA_REF_H) $(TREE_PASS_H) langhooks.h $(TREE_DATA_REF_H) $(TREE_PASS_H) langhooks.h
sese.o: sese.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
domwalk.h pointer-set.h value-prof.h
graphite.o: graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ graphite.o: graphite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \ $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \ $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) $(SCEV_H) $(TREE_PASS_H) tree-chrec.h graphite.h \ $(TREE_DATA_REF_H) tree-pass.h graphite.h \
pointer-set.h value-prof.h pointer-set.h value-prof.h graphite-ppl.h sese.h \
graphite-scop-detection.h graphite-clast-to-gimple.h \
graphite-poly.h graphite-sese-to-poly.h
graphite-blocking.o: graphite-blocking.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TOPLEV_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(GIMPLE_H) $(TREE_DATA_REF_H) tree-pass.h \
graphite.h graphite-poly.h graphite-ppl.h
graphite-clast-to-gimple.o: graphite-clast-to-gimple.c $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h graphite.h \
pointer-set.h value-prof.h graphite-ppl.h sese.h \
graphite-scop-detection.h graphite-clast-to-gimple.h graphite-poly.h \
graphite-dependences.h
graphite-dependences.o: graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TOPLEV_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(GIMPLE_H) $(TREE_DATA_REF_H) tree-pass.h \
graphite.h graphite-poly.h graphite-ppl.h graphite-dependences.h
graphite-interchange.o: graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TOPLEV_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
$(GIMPLE_H) $(TREE_DATA_REF_H) tree-pass.h \
graphite.h graphite-poly.h graphite-ppl.h
graphite-poly.o: graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h graphite.h graphite-dependences.h \
pointer-set.h value-prof.h graphite-ppl.h sese.h output.h graphite-poly.h
graphite-ppl.o: graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) graphite-ppl.h
graphite-scop-detection.o: graphite-scop-detection.c $(CONFIG_H) $(SYSTEM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h graphite.h $(TM_H) \
value-prof.h graphite-ppl.h sese.h pointer-set.h coretypes.h \
graphite-scop-detection.h graphite-poly.h
graphite-sese-to-poly.o: graphite-sese-to-poly.c $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h graphite.h \
pointer-set.h value-prof.h graphite-ppl.h sese.h \
graphite-scop-detection.h graphite-sese-to-poly.h $(PARAMS_H) \
graphite-clast-to-gimple.h graphite-poly.h
tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \ $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
$(TREE_DUMP_H) $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TOPLEV_H) \ $(TREE_DUMP_H) $(CFGLOOP_H) $(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TOPLEV_H) \
......
...@@ -338,6 +338,7 @@ alloc_loop (void) ...@@ -338,6 +338,7 @@ alloc_loop (void)
loop->exits = GGC_CNEW (struct loop_exit); loop->exits = GGC_CNEW (struct loop_exit);
loop->exits->next = loop->exits->prev = loop->exits; loop->exits->next = loop->exits->prev = loop->exits;
loop->can_be_parallel = false;
return loop; return loop;
} }
......
...@@ -157,6 +157,9 @@ struct GTY ((chain_next ("%h.next"))) loop { ...@@ -157,6 +157,9 @@ struct GTY ((chain_next ("%h.next"))) loop {
/* Head of the cyclic list of the exits of the loop. */ /* Head of the cyclic list of the exits of the loop. */
struct loop_exit *exits; struct loop_exit *exits;
/* True if the loop can be parallel. */
bool can_be_parallel;
}; };
/* Flags for state of loop structure. */ /* Flags for state of loop structure. */
......
...@@ -571,6 +571,16 @@ fgraphite ...@@ -571,6 +571,16 @@ fgraphite
Common Report Var(flag_graphite) Common Report Var(flag_graphite)
Enable in and out of Graphite representation Enable in and out of Graphite representation
; This option is not documented as it does not perform any useful optimization.
fgraphite-identity
Common Report Var(flag_graphite_identity) Optimization
Enable Graphite Identity transformation
; This option is not documented as it will be removed
fgraphite-force-parallel
Common Report Var(flag_graphite_force_parallel) Optimization
Mark all loops as parallel
floop-strip-mine floop-strip-mine
Common Report Var(flag_loop_strip_mine) Optimization Common Report Var(flag_loop_strip_mine) Optimization
Enable Loop Strip Mining transformation Enable Loop Strip Mining transformation
...@@ -583,11 +593,6 @@ floop-block ...@@ -583,11 +593,6 @@ floop-block
Common Report Var(flag_loop_block) Optimization Common Report Var(flag_loop_block) Optimization
Enable Loop Blocking transformation Enable Loop Blocking transformation
; This option is not documented as it does not perform any useful optimization.
fgraphite-identity
Common Report Var(flag_graphite_identity) Optimization
Enable Graphite Identity transformation
fguess-branch-probability fguess-branch-probability
Common Report Var(flag_guess_branch_prob) Optimization Common Report Var(flag_guess_branch_prob) Optimization
Enable guessing of branch probabilities Enable guessing of branch probabilities
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -658,6 +658,11 @@ init_optimization_passes (void) ...@@ -658,6 +658,11 @@ init_optimization_passes (void)
NEXT_PASS (pass_loop_distribution); NEXT_PASS (pass_loop_distribution);
NEXT_PASS (pass_linear_transform); NEXT_PASS (pass_linear_transform);
NEXT_PASS (pass_graphite_transforms); NEXT_PASS (pass_graphite_transforms);
{
struct opt_pass **p = &pass_graphite_transforms.pass.sub;
NEXT_PASS (pass_dce_loop);
NEXT_PASS (pass_lim);
}
NEXT_PASS (pass_iv_canon); NEXT_PASS (pass_iv_canon);
NEXT_PASS (pass_if_conversion); NEXT_PASS (pass_if_conversion);
NEXT_PASS (pass_vectorize); NEXT_PASS (pass_vectorize);
......
...@@ -1801,7 +1801,8 @@ process_options (void) ...@@ -1801,7 +1801,8 @@ process_options (void)
|| flag_loop_block || flag_loop_block
|| flag_loop_interchange || flag_loop_interchange
|| flag_loop_strip_mine || flag_loop_strip_mine
|| flag_graphite_identity) || flag_graphite_identity
|| flag_graphite_force_parallel)
sorry ("Graphite loop optimizations cannot be used"); sorry ("Graphite loop optimizations cannot be used");
#endif #endif
...@@ -2046,7 +2047,7 @@ process_options (void) ...@@ -2046,7 +2047,7 @@ process_options (void)
if (flag_signaling_nans) if (flag_signaling_nans)
flag_trapping_math = 1; flag_trapping_math = 1;
/* We cannot reassociate if we want traps or signed zeros.  */ /* We cannot reassociate if we want traps or signed zeros. */
if (flag_associative_math && (flag_trapping_math || flag_signed_zeros)) if (flag_associative_math && (flag_trapping_math || flag_signed_zeros))
{ {
warning (0, "-fassociative-math disabled; other options take precedence"); warning (0, "-fassociative-math disabled; other options take precedence");
......
...@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h" #include "flags.h"
#include "tree-inline.h" #include "tree-inline.h"
#include "tree-scalar-evolution.h" #include "tree-scalar-evolution.h"
#include "toplev.h"
#include "tree-vectorizer.h" #include "tree-vectorizer.h"
/* The loop superpass. */ /* The loop superpass. */
...@@ -307,9 +308,12 @@ gate_graphite_transforms (void) ...@@ -307,9 +308,12 @@ gate_graphite_transforms (void)
/* Enable -fgraphite pass if any one of the graphite optimization flags /* Enable -fgraphite pass if any one of the graphite optimization flags
is turned on. */ is turned on. */
if (flag_loop_block || flag_loop_interchange || flag_loop_strip_mine if (flag_loop_block || flag_loop_interchange || flag_loop_strip_mine
|| flag_graphite_identity) || flag_graphite_identity || flag_graphite_force_parallel)
flag_graphite = 1; flag_graphite = 1;
if (flag_loop_block)
sorry ("loop blocking not implemented");
return flag_graphite != 0; return flag_graphite != 0;
} }
......
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