* [PATCH 01/65] Fix invariant phi node removal.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (4 preceding siblings ...)
2010-08-02 20:21 ` [PATCH 03/65] Use size_one_node Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:21 ` [PATCH 02/65] Fix type of integer_one_node for fold_build of POINTER_PLUS_EXPR Sebastian Pop
` (61 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-05-07 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
phi_arg_in_outermost_loop.
(remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
(remove_invariant_phi): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@159165 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 7 +++++++
gcc/ChangeLog.graphite | 7 +++++++
gcc/graphite-sese-to-poly.c | 20 +++++++++++---------
3 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ad2b271..63e75ab 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
+ phi_arg_in_outermost_loop.
+ (remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
+ (remove_invariant_phi): Same.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* common.opt (ftree-loop-distribute-patterns): New.
* invoke.texi (-ftree-loop-distribute-patterns): Documented.
* opts.c (decode_options): Enable flag_tree_loop_distribute_patterns
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b45469b..00849f2 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,10 @@
+2010-05-07 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
+ phi_arg_in_outermost_loop.
+ (remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
+ (remove_invariant_phi): Same.
+
2010-04-12 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-blocking.c
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 7f83ffc..68cb2a4 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -73,21 +73,23 @@ var_used_in_not_loop_header_phi_node (tree var)
return result;
}
-/* Returns the index of the phi argument corresponding to the initial
- value in the loop. */
+/* Returns the index of the PHI argument defined in the outermost
+ loop. */
static size_t
-loop_entry_phi_arg (gimple phi)
+phi_arg_in_outermost_loop (gimple phi)
{
loop_p loop = gimple_bb (phi)->loop_father;
- size_t i;
+ size_t i, res = 0;
for (i = 0; i < gimple_phi_num_args (phi); i++)
if (!flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, i)->src))
- return i;
+ {
+ loop = gimple_phi_arg_edge (phi, i)->src->loop_father;
+ res = i;
+ }
- gcc_unreachable ();
- return 0;
+ return res;
}
/* Removes a simple copy phi node "RES = phi (INIT, RES)" at position
@@ -98,7 +100,7 @@ remove_simple_copy_phi (gimple_stmt_iterator *psi)
{
gimple phi = gsi_stmt (*psi);
tree res = gimple_phi_result (phi);
- size_t entry = loop_entry_phi_arg (phi);
+ size_t entry = phi_arg_in_outermost_loop (phi);
tree init = gimple_phi_arg_def (phi, entry);
gimple stmt = gimple_build_assign (res, init);
edge e = gimple_phi_arg_edge (phi, entry);
@@ -118,7 +120,7 @@ remove_invariant_phi (sese region, gimple_stmt_iterator *psi)
loop_p loop = loop_containing_stmt (phi);
tree res = gimple_phi_result (phi);
tree scev = scalar_evolution_in_region (region, loop, res);
- size_t entry = loop_entry_phi_arg (phi);
+ size_t entry = phi_arg_in_outermost_loop (phi);
edge e = gimple_phi_arg_edge (phi, entry);
tree var;
gimple stmt;
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 03/65] Use size_one_node.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (3 preceding siblings ...)
2010-08-02 20:21 ` [PATCH 06/65] Fix refined region tree nesting Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:21 ` [PATCH 01/65] Fix invariant phi node removal Sebastian Pop
` (62 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-05-26 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
size_one_node.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@159891 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index eca1bb6..6341a15 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-05-26 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
+ size_one_node.
+
2010-05-07 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Fix
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 02/65] Fix type of integer_one_node for fold_build of POINTER_PLUS_EXPR.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (5 preceding siblings ...)
2010-08-02 20:21 ` [PATCH 01/65] Fix invariant phi node removal Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:21 ` [PATCH 08/65] Do not gather loop exit conditions on the basic blocks outside the loop Sebastian Pop
` (60 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-05-07 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Fix
type of integer_one_node for fold_build of POINTER_PLUS_EXPR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@159166 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 00849f2..eca1bb6 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-05-07 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Fix
+ type of integer_one_node for fold_build of POINTER_PLUS_EXPR.
+
+2010-05-07 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
phi_arg_in_outermost_loop.
(remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 06/65] Fix refined region tree nesting.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (2 preceding siblings ...)
2010-08-02 20:21 ` [PATCH 05/65] Skeleton for the new SCoP detection Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:21 ` [PATCH 03/65] Use size_one_node Sebastian Pop
` (63 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-08 Tobias Grosser <grosser@fim.uni-passau.de>
* refined-regions.c (create_region): Only initialize the region.
(find_regions_with_entry): Initialize parent relation and bbmap
correctly.
(build_regions_tree): Set outermost_region to region instead of
topmost_region.
(calculate_region_tree): Remove unneeded parameters.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160441 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index a955dfe..db1ea30 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,12 @@
+2010-06-08 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ * refined-regions.c (create_region): Only initialize the region.
+ (find_regions_with_entry): Initialize parent relation and bbmap
+ correctly.
+ (build_regions_tree): Set outermost_region to region instead of
+ topmost_region.
+ (calculate_region_tree): Remove unneeded parameters.
+
2010-06-02 Tobias Grosser <grosser@fim.uni-passau.de>
* graphite-scop-detection.c (is_scop_p): New.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 09/65] Call compute_overall_effect_of_inner_loop from instantiate_scev_name.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
2010-08-02 20:21 ` [PATCH 07/65] Fix comments and indentation Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:21 ` [PATCH 05/65] Skeleton for the new SCoP detection Sebastian Pop
` (65 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
* tree-scalar-evolution.c (instantiate_scev_name): Do not fail
the scev analysis when the variable is not used outside the loop
in a close phi node: call compute_overall_effect_of_inner_loop.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160513 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 36639b1..c6b23cd 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,11 @@
2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
+ * tree-scalar-evolution.c (instantiate_scev_name): Do not fail
+ the scev analysis when the variable is not used outside the loop
+ in a close phi node: call compute_overall_effect_of_inner_loop.
+
+2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (single_pred_cond): Renamed
single_pred_cond_non_loop_exit. Return NULL for loop exit edges.
(build_sese_conditions_before): Renamed call to single_pred_cond.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 00/65] Merge from the Graphite branch to trunk
@ 2010-08-02 20:21 Sebastian Pop
2010-08-02 20:21 ` [PATCH 07/65] Fix comments and indentation Sebastian Pop
` (67 more replies)
0 siblings, 68 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite, Sebastian Pop
Hi,
This patch-set merges the changes that went into the Graphite branch
for the past two months. These changes are stable: the automatic
testers passed bootstrap and CPU2006 benchmarks with no fails and with
various Graphite flag configurations.
Note that some of the patches contain only a change in
ChangeLog.graphite, these are either already in trunk, or implement
functionality that is not stable enough, and will remain for now in
the branch. These changes are those linked to the new SCoP detection
algorithm.
I am testing this merge on amd64-linux. I will wait for 48 hours to
let reviewers enough time to re-review these patches. All these
changes have already been discussed prior to their commit to the
Graphite branch. If there are other changes before committing to
trunk, I will implement the needed changes.
Thanks,
Sebastian
grosser (7):
Add analysis pass to build the refined program structure tree.
Skeleton for the new SCoP detection.
Fix refined region tree nesting.
Resolve CLooG's value_* macros to their respective mpz_*
counterparts.
Move cloog-related functions from graphite-ppl.{c,h} to new
graphite-cloog-util.{c,h}.
Partially removing cloog.h and graphite-clast-to-gimple.h where
possible. Removing unused function check_poly_representation.
Fix flipped condition using mpz_sgn.
spop (58):
Fix invariant phi node removal.
Fix type of integer_one_node for fold_build of POINTER_PLUS_EXPR.
Use size_one_node.
Fix comments and indentation.
Do not gather loop exit conditions on the basic blocks outside the
loop.
Call compute_overall_effect_of_inner_loop from instantiate_scev_name.
Don't call pbb_to_depth_to_oldiv from compute_type_for_level.
Launch dotty in background.
Detect commutative reductions in all the scops before rewriting out
of SSA all the other scalar dependences.
Remove insert_copyout and insert_copyin.
Also rewrite out of SSA scalar dependences going outside the SCoP
region.
Remove rename_nb_iterations and rename_sese_parameters
Schedule a copy_prop pass before graphite.
Add more debug counter guards.
Split rewrite_cross_bb_scalar_deps_out_of_ssa out from
rewrite_reductions_out_of_ssa.
Always insert out of SSA copies on edges except for loop->latch.
Fix testcase: call abort.
Early return in rewrite_commutative_reductions_out_of_ssa when
flag_associative_math is not set.
Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps.
Remove copy_renames.
Replace map with rename_map.
Remove dead code.
Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from
rewrite_cross_bb_phi_deps.
Fix 416.gamess miscompile: special case the rewrite of degenerate phi
nodes.
Print bbs in refined region tree.
Add testcase for miscompile in gamess.
Remove insert_loop_close_phis.
Remove expand_scalar_variables_ hack.
chrec_apply should only apply to the specified variable.
Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps.
Remove uses of loop->single_iv.
Bump the size of scevs.
Scevs could be expressions without chrecs and still be
scev_analyzable_p.
Special case non close-phi nodes with one argument in
rewrite_close_phi_out_of_ssa.
Add testcase for PR42729 and fix handling of gimple_debug info.
Correctly handle SSA_NAME_IS_DEFAULT_DEF in
rewrite_close_phi_out_of_ssa.
Do not rewrite out of SSA scalar phi nodes that can be
scev_analyzable_p.
Unshare the scev before code generating it.
Add testcase for PR20742.
Do not translate out-of-SSA close phi nodes that can be analyzed with
scev.
Dot refined regions.
Add loop_exits_from_bb_p.
Enhance region checks.
Do not instantiate default definitions in instantiate_scev_name.
Use SSA_NAME_DEF_STMT only on SSA_NAMEs.
Propagate constant values or parametric expressions outside the scop
region.
Call scev_analyzable_p only on is_gimple_reg.
Fix tonto: call propagate_expr_outside_region.
Call scev_reset_htab when Graphite out-of-SSA has changed something.
Reintroduce necessary CLooG accessors to graphite. Masked by
CLOOG_ORG.
Make CLooG options compatible to newer CLooG releases and pass
options to build_cloog_prog (CLOOG_ORG).
Adapt to new CLAST structure within upstream CLooG version and retain
compatibility to CLooG Legacy.
Introduce compatibility to newer CLooG's CloogState and mask the use
with macros where possible.
Adapt to new CloogScattering abstraction, introduced in official
CLooG versions (CLOOG_ORG).
Remove cloog_initialize and cloog_finalize when using official CLooG
releases.
Fix typos.
Fix gamess: the only constant phi nodes with one argument are
is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF.
Fix miscompile of 416.gamess.
gcc/ChangeLog | 552 +++++++++++++++
gcc/ChangeLog.graphite | 704 ++++++++++++++++++-
gcc/Makefile.in | 9 +-
gcc/cfgloop.c | 20 +-
gcc/cfgloop.h | 7 +-
gcc/dbgcnt.def | 1 +
gcc/graphite-blocking.c | 1 -
gcc/graphite-clast-to-gimple.c | 356 ++++------
gcc/graphite-clast-to-gimple.h | 6 +-
gcc/graphite-cloog-compat.h | 263 +++++++
gcc/graphite-cloog-util.c | 299 ++++++++
gcc/graphite-cloog-util.h | 36 +
gcc/graphite-dependences.c | 5 +-
gcc/graphite-interchange.c | 3 +-
gcc/graphite-poly.c | 7 +-
gcc/graphite-ppl.c | 248 +-------
gcc/graphite-ppl.h | 6 -
gcc/graphite-scop-detection.c | 3 +-
gcc/graphite-sese-to-poly.c | 544 ++++++++-------
gcc/graphite-sese-to-poly.h | 5 +-
gcc/graphite.c | 32 +-
gcc/params.def | 2 +-
gcc/passes.c | 7 +-
gcc/sese.c | 1062 ++++------------------------
gcc/sese.h | 23 +-
gcc/testsuite/ChangeLog | 54 ++
gcc/testsuite/gcc.dg/graphite/id-20.c | 26 +
gcc/testsuite/gcc.dg/graphite/id-22.c | 15 +
gcc/testsuite/gcc.dg/graphite/id-23.c | 22 +
gcc/testsuite/gcc.dg/graphite/id-24.c | 22 +
gcc/testsuite/gcc.dg/graphite/id-25.c | 34 +
gcc/testsuite/gcc.dg/graphite/id-26.c | 24 +
gcc/testsuite/gcc.dg/graphite/pr42729.c | 15 +
gcc/testsuite/gcc.dg/graphite/run-id-2.c | 12 +-
gcc/testsuite/gcc.dg/graphite/run-id-5.c | 54 ++
gcc/testsuite/gcc.dg/graphite/run-id-6.c | 55 ++
gcc/testsuite/gcc.dg/tree-ssa/pr20742.c | 18 +
gcc/testsuite/gfortran.dg/graphite/id-20.f | 10 +
gcc/testsuite/gfortran.dg/graphite/id-21.f | 20 +
gcc/testsuite/gfortran.dg/graphite/id-22.f | 10 +
gcc/timevar.def | 1 +
gcc/tree-chrec.c | 62 ++-
gcc/tree-chrec.h | 1 +
gcc/tree-pass.h | 1 +
gcc/tree-scalar-evolution.c | 13 +-
gcc/tree-ssa-loop.c | 19 +
46 files changed, 2976 insertions(+), 1713 deletions(-)
create mode 100644 gcc/graphite-cloog-compat.h
create mode 100644 gcc/graphite-cloog-util.c
create mode 100644 gcc/graphite-cloog-util.h
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-20.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-22.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-23.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-24.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-25.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-26.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42729.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-5.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-6.c
create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20742.c
create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-20.f
create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-21.f
create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-22.f
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 07/65] Fix comments and indentation.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:21 ` [PATCH 09/65] Call compute_overall_effect_of_inner_loop from instantiate_scev_name Sebastian Pop
` (66 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
* graphite-poly.h: Fix comments and indentation.
* graphite-sese-to-poly.c: Same.
(build_sese_conditions_before): Compute stmt and gbb only when needed.
* tree-chrec.c: Fix comments and indentation.
(tree-ssa-loop-niter.c): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160511 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index db1ea30..665f146 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-poly.h: Fix comments and indentation.
+ * graphite-sese-to-poly.c: Same.
+ (build_sese_conditions_before): Compute stmt and gbb only when needed.
+ * tree-chrec.c: Fix comments and indentation.
+ (tree-ssa-loop-niter.c): Same.
+
2010-06-08 Tobias Grosser <grosser@fim.uni-passau.de>
* refined-regions.c (create_region): Only initialize the region.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 05/65] Skeleton for the new SCoP detection.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
2010-08-02 20:21 ` [PATCH 07/65] Fix comments and indentation Sebastian Pop
2010-08-02 20:21 ` [PATCH 09/65] Call compute_overall_effect_of_inner_loop from instantiate_scev_name Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:21 ` [PATCH 06/65] Fix refined region tree nesting Sebastian Pop
` (64 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-02 Tobias Grosser <grosser@fim.uni-passau.de>
* graphite-scop-detection.c (is_scop_p): New.
(build_scops_new): New. A skeleton for the new scop detection.
(build_scops_old): Renamed from build_scops.
(build_scops): New version. Call the new and the old scop
detection.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160192 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 5fe8322..a955dfe 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-06-02 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ * graphite-scop-detection.c (is_scop_p): New.
+ (build_scops_new): New. A skeleton for the new scop detection.
+ (build_scops_old): Renamed from build_scops.
+ (build_scops): New version. Call the new and the old scop
+ detection.
+
2010-05-27 Tobias Grosser <grosser@fim.uni-passau.de>
Antoniu Pop <antoniu.pop@gmail.com>
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 08/65] Do not gather loop exit conditions on the basic blocks outside the loop.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (6 preceding siblings ...)
2010-08-02 20:21 ` [PATCH 02/65] Fix type of integer_one_node for fold_build of POINTER_PLUS_EXPR Sebastian Pop
@ 2010-08-02 20:21 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 21/65] Early return in rewrite_commutative_reductions_out_of_ssa when flag_associative_math is not set Sebastian Pop
` (59 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:21 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (single_pred_cond): Renamed
single_pred_cond_non_loop_exit. Return NULL for loop exit edges.
(build_sese_conditions_before): Renamed call to single_pred_cond.
(build_sese_conditions_after): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160512 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 665f146..36639b1 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (single_pred_cond): Renamed
+ single_pred_cond_non_loop_exit. Return NULL for loop exit edges.
+ (build_sese_conditions_before): Renamed call to single_pred_cond.
+ (build_sese_conditions_after): Same.
+
+2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-poly.h: Fix comments and indentation.
* graphite-sese-to-poly.c: Same.
(build_sese_conditions_before): Compute stmt and gbb only when needed.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 10/65] Don't call pbb_to_depth_to_oldiv from compute_type_for_level.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (8 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 21/65] Early return in rewrite_commutative_reductions_out_of_ssa when flag_associative_math is not set Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 17/65] Add more debug counter guards Sebastian Pop
` (57 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-11 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (gcc_type_for_interval): Do not pass
old_type in parameter.
(gcc_type_for_value): Update call to gcc_type_for_interval.
(compute_type_for_level_1): Renamed compute_type_for_level.
Update call to gcc_type_for_interval.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160624 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c6b23cd..4b802ee 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-06-11 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (gcc_type_for_interval): Do not pass
+ old_type in parameter.
+ (gcc_type_for_value): Update call to gcc_type_for_interval.
+ (compute_type_for_level_1): Renamed compute_type_for_level.
+ Update call to gcc_type_for_interval.
+
2010-06-09 Sebastian Pop <sebastian.pop@amd.com>
* tree-scalar-evolution.c (instantiate_scev_name): Do not fail
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 21/65] Early return in rewrite_commutative_reductions_out_of_ssa when flag_associative_math is not set.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (7 preceding siblings ...)
2010-08-02 20:21 ` [PATCH 08/65] Do not gather loop exit conditions on the basic blocks outside the loop Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 10/65] Don't call pbb_to_depth_to_oldiv from compute_type_for_level Sebastian Pop
` (58 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa):
Early return in when flag_associative_math is not set.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161294 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 5 +++++
gcc/graphite-sese-to-poly.c | 3 +++
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ec97649..6f1a9c6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa):
+ Early return in when flag_associative_math is not set.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Always insert out
of SSA copies on edges except for loop->latch.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index abeda2a..53c7344 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa):
+ Early return in when flag_associative_math is not set.
+
+2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/run-id-2.c: Call abort.
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 75879ed..9aa4070 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2829,6 +2829,9 @@ rewrite_commutative_reductions_out_of_ssa (sese region, sbitmap reductions)
loop_iterator li;
loop_p loop;
+ if (!flag_associative_math)
+ return;
+
FOR_EACH_LOOP (li, loop, 0)
if (loop_in_sese_p (loop, region))
rewrite_commutative_reductions_out_of_ssa_loop (loop, reductions);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 17/65] Add more debug counter guards.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (9 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 10/65] Don't call pbb_to_depth_to_oldiv from compute_type_for_level Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 12/65] Detect commutative reductions in all the scops before rewriting out of SSA all the other scalar dependences Sebastian Pop
` (56 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite.c (graphite_transform_loops): Add two more dbg_cnt calls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161290 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 11 +++++++++++
gcc/ChangeLog.graphite | 4 ++++
gcc/Makefile.in | 2 +-
gcc/dbgcnt.def | 1 +
gcc/graphite.c | 17 +++++++++++------
5 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f08de60..9980de1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite.c (graphite_transform_loops): Add two more dbg_cnt calls.
+
+2010-08-02 Alexander Monakov <amonakov@ispras.ru>
+
+ * dbgcnt.def (graphite_scop): New counter.
+ * graphite.c: Include dbgcnt.h.
+ (graphite_transform_loops): Use new counter to limit transformations.
+ * Makefile.in (graphite.o): Depend on DBGCNT_H.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* passes.c (init_optimization_passes): Add pass_graphite.
Schedule a pass_copy_prop before pass_graphite_transforms.
* timevar.def (TV_GRAPHITE): Declared.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 8b72f3e..166d9f3 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,7 @@
+2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite.c (graphite_transform_loops): Add two more dbg_cnt calls.
+
2010-06-15 Sebastian Pop <sebastian.pop@amd.com>
* passes.c (init_optimization_passes): Add pass_graphite.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a6b3460..f10a9b0 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2662,7 +2662,7 @@ sese.o: sese.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
pointer-set.h $(GIMPLE_H) sese.h tree-pretty-print.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) $(DIAGNOSTIC_CORE_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) $(DBGCNT_H) \
$(PREDICT_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 \
diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def
index ba7ce1f..0492d66 100644
--- a/gcc/dbgcnt.def
+++ b/gcc/dbgcnt.def
@@ -157,6 +157,7 @@ DEBUG_COUNTER (dse2)
DEBUG_COUNTER (gcse2_delete)
DEBUG_COUNTER (global_alloc_at_func)
DEBUG_COUNTER (global_alloc_at_reg)
+DEBUG_COUNTER (graphite_scop)
DEBUG_COUNTER (hoist)
DEBUG_COUNTER (hoist_insn)
DEBUG_COUNTER (ia64_sched2)
diff --git a/gcc/graphite.c b/gcc/graphite.c
index c4fd2a3..5b3b6aa 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "sese.h"
#include "predict.h"
+#include "dbgcnt.h"
#ifdef HAVE_cloog
@@ -271,18 +272,22 @@ graphite_transform_loops (void)
sbitmap_zero (reductions);
for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
- rewrite_commutative_reductions_out_of_ssa (SCOP_REGION (scop), reductions);
+ if (dbg_cnt (graphite_scop))
+ rewrite_commutative_reductions_out_of_ssa (SCOP_REGION (scop),
+ reductions);
for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
- {
- rewrite_reductions_out_of_ssa (scop);
- build_scop_bbs (scop, reductions);
- }
+ if (dbg_cnt (graphite_scop))
+ {
+ rewrite_reductions_out_of_ssa (scop);
+ build_scop_bbs (scop, reductions);
+ }
sbitmap_free (reductions);
for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
- build_poly_scop (scop);
+ if (dbg_cnt (graphite_scop))
+ build_poly_scop (scop);
for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
if (POLY_SCOP_P (scop)
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 18/65] Split rewrite_cross_bb_scalar_deps_out_of_ssa out from rewrite_reductions_out_of_ssa.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (14 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 14/65] Also rewrite out of SSA scalar dependences going outside the SCoP region Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 13/65] Remove insert_copyout and insert_copyin Sebastian Pop
` (51 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps_out_of_ssa):
Split out of rewrite_reductions_out_of_ssa.
* graphite-sese-to-poly.h (rewrite_cross_bb_scalar_deps_out_of_ssa):
Declared.
* graphite.c (graphite_transform_loops): Call it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161291 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 8 ++++++++
gcc/ChangeLog.graphite | 8 ++++++++
gcc/graphite-sese-to-poly.c | 11 +++++++++++
gcc/graphite-sese-to-poly.h | 1 +
gcc/graphite.c | 1 +
5 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9980de1..bfdc49a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps_out_of_ssa):
+ Split out of rewrite_reductions_out_of_ssa.
+ * graphite-sese-to-poly.h (rewrite_cross_bb_scalar_deps_out_of_ssa):
+ Declared.
+ * graphite.c (graphite_transform_loops): Call it.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite.c (graphite_transform_loops): Add two more dbg_cnt calls.
2010-08-02 Alexander Monakov <amonakov@ispras.ru>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 166d9f3..0d64cc3 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,13 @@
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps_out_of_ssa):
+ Split out of rewrite_reductions_out_of_ssa.
+ * graphite-sese-to-poly.h (rewrite_cross_bb_scalar_deps_out_of_ssa):
+ Declared.
+ * graphite.c (graphite_transform_loops): Call it.
+
+2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite.c (graphite_transform_loops): Add two more dbg_cnt calls.
2010-06-15 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 8baf379..8bcd684 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2425,6 +2425,17 @@ rewrite_reductions_out_of_ssa (scop_p scop)
#ifdef ENABLE_CHECKING
verify_loop_closed_ssa (true);
#endif
+}
+
+
+/* Rewrite out of SSA all the reduction phi nodes of SCOP. */
+
+void
+rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p scop)
+{
+ basic_block bb;
+ gimple_stmt_iterator psi;
+ sese region = SCOP_REGION (scop);
FOR_EACH_BB (bb)
if (bb_in_sese_p (bb, region))
diff --git a/gcc/graphite-sese-to-poly.h b/gcc/graphite-sese-to-poly.h
index 2e0cc08..558a283 100644
--- a/gcc/graphite-sese-to-poly.h
+++ b/gcc/graphite-sese-to-poly.h
@@ -32,6 +32,7 @@ void build_poly_scop (scop_p);
void check_poly_representation (scop_p);
void rewrite_commutative_reductions_out_of_ssa (sese, sbitmap);
void rewrite_reductions_out_of_ssa (scop_p);
+void rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p);
void build_scop_bbs (scop_p, sbitmap);
#endif
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 5b3b6aa..4bb4344 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -280,6 +280,7 @@ graphite_transform_loops (void)
if (dbg_cnt (graphite_scop))
{
rewrite_reductions_out_of_ssa (scop);
+ rewrite_cross_bb_scalar_deps_out_of_ssa (scop);
build_scop_bbs (scop, reductions);
}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 19/65] Always insert out of SSA copies on edges except for loop->latch.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (16 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 13/65] Remove insert_copyout and insert_copyin Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 16/65] Schedule a copy_prop pass before graphite Sebastian Pop
` (49 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Always insert out
of SSA copies on edges except for loop->latch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161292 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 ++++
gcc/ChangeLog.graphite | 5 ++++
gcc/graphite-sese-to-poly.c | 54 ++++---------------------------------------
3 files changed, 15 insertions(+), 49 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bfdc49a..ec97649 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Always insert out
+ of SSA copies on edges except for loop->latch.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps_out_of_ssa):
Split out of rewrite_reductions_out_of_ssa.
* graphite-sese-to-poly.h (rewrite_cross_bb_scalar_deps_out_of_ssa):
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 0d64cc3..47cf924 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Always insert out
+ of SSA copies on edges except for loop->latch.
+
+2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps_out_of_ssa):
Split out of rewrite_reductions_out_of_ssa.
* graphite-sese-to-poly.h (rewrite_cross_bb_scalar_deps_out_of_ssa):
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 8bcd684..75879ed 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2246,58 +2246,14 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi)
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree arg = gimple_phi_arg_def (phi, i);
+ edge e = gimple_phi_arg_edge (phi, i);
- /* Try to avoid the insertion on edges as much as possible: this
- would avoid the insertion of code on loop latch edges, making
- the pattern matching of the vectorizer happy, or it would
- avoid the insertion of useless basic blocks. Note that it is
- incorrect to insert out of SSA copies close by their
- definition when they are more than two loop levels apart:
- for example, starting from a double nested loop
-
- | a = ...
- | loop_1
- | loop_2
- | b = phi (a, c)
- | c = ...
- | end_2
- | end_1
-
- the following transform is incorrect
-
- | a = ...
- | Red[0] = a
- | loop_1
- | loop_2
- | b = Red[0]
- | c = ...
- | Red[0] = c
- | end_2
- | end_1
-
- whereas inserting the copy on the incoming edge is correct
-
- | a = ...
- | loop_1
- | Red[0] = a
- | loop_2
- | b = Red[0]
- | c = ...
- | Red[0] = c
- | end_2
- | end_1
- */
- if (TREE_CODE (arg) == SSA_NAME
- && is_gimple_reg (arg)
- && gimple_bb (SSA_NAME_DEF_STMT (arg))
- && (flow_bb_inside_loop_p (bb->loop_father,
- gimple_bb (SSA_NAME_DEF_STMT (arg)))
- || flow_bb_inside_loop_p (loop_outer (bb->loop_father),
- gimple_bb (SSA_NAME_DEF_STMT (arg)))))
+ /* Avoid the insertion of code in the loop latch to please the
+ pattern matching of the vectorizer. */
+ if (e->src == bb->loop_father->latch)
insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
else
- insert_out_of_ssa_copy_on_edge (gimple_phi_arg_edge (phi, i),
- zero_dim_array, arg);
+ insert_out_of_ssa_copy_on_edge (e, zero_dim_array, arg);
}
var = force_gimple_operand (zero_dim_array, &stmts, true, NULL_TREE);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 16/65] Schedule a copy_prop pass before graphite.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (17 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 19/65] Always insert out of SSA copies on edges except for loop->latch Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 23/65] Remove copy_renames Sebastian Pop
` (48 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-15 Sebastian Pop <sebastian.pop@amd.com>
* passes.c (init_optimization_passes): Add pass_graphite.
Schedule a pass_copy_prop before pass_graphite_transforms.
* timevar.def (TV_GRAPHITE): Declared.
* tree-pass.h (pass_graphite): Declared.
* tree-ssa-loop.c (pass_graphite): New.
* gcc.dg/graphite/id-20.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160791 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 8 ++++++++
gcc/ChangeLog.graphite | 10 ++++++++++
gcc/passes.c | 7 +++++--
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gcc.dg/graphite/id-20.c | 26 ++++++++++++++++++++++++++
gcc/timevar.def | 1 +
gcc/tree-pass.h | 1 +
gcc/tree-ssa-loop.c | 19 +++++++++++++++++++
8 files changed, 74 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-20.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d05f124..f08de60 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * passes.c (init_optimization_passes): Add pass_graphite.
+ Schedule a pass_copy_prop before pass_graphite_transforms.
+ * timevar.def (TV_GRAPHITE): Declared.
+ * tree-pass.h (pass_graphite): Declared.
+ * tree-ssa-loop.c (pass_graphite): New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter.
Remove calls to rename_nb_iterations and rename_sese_parameters.
* graphite-clast-to-gimple.h (gloog): Update declaration.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index aac1c96..8b72f3e 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,13 @@
+2010-06-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * passes.c (init_optimization_passes): Add pass_graphite.
+ Schedule a pass_copy_prop before pass_graphite_transforms.
+ * timevar.def (TV_GRAPHITE): Declared.
+ * tree-pass.h (pass_graphite): Declared.
+ * tree-ssa-loop.c (pass_graphite): New.
+
+ * gcc.dg/graphite/id-20.c: New.
+
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter.
diff --git a/gcc/passes.c b/gcc/passes.c
index 5a4cdc8..e2b9369 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -900,9 +900,12 @@ init_optimization_passes (void)
NEXT_PASS (pass_check_data_deps);
NEXT_PASS (pass_loop_distribution);
NEXT_PASS (pass_linear_transform);
- NEXT_PASS (pass_graphite_transforms);
+ NEXT_PASS (pass_copy_prop);
+ NEXT_PASS (pass_graphite);
{
- struct opt_pass **p = &pass_graphite_transforms.pass.sub;
+ struct opt_pass **p = &pass_graphite.pass.sub;
+ NEXT_PASS (pass_copy_prop);
+ NEXT_PASS (pass_graphite_transforms);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_dce_loop);
NEXT_PASS (pass_lim);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 136a739..d4d8d90 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gcc.dg/graphite/id-20.c: New.
+
2010-08-02 Bernd Schmidt <bernds@codesourcery.com>
PR target/40457
diff --git a/gcc/testsuite/gcc.dg/graphite/id-20.c b/gcc/testsuite/gcc.dg/graphite/id-20.c
new file mode 100644
index 0000000..7e0cf6d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-20.c
@@ -0,0 +1,26 @@
+/* { dg-options "-O3 -fgraphite-identity -ffast-math" } */
+
+typedef enum
+{
+ I_SLICE,
+} SliceType;
+typedef struct
+{
+ int type;
+} ImageParameters;
+extern ImageParameters *img;
+int A[64], B[64], C[13][8][8], D[13][8][8];
+
+void
+foo (int q, int temp)
+{
+ int i, j, k;
+ for(k=0; k<13; k++)
+ for(j=0; j<8; j++)
+ for(i=0; i<8; i++)
+ {
+ if (img->type == I_SLICE)
+ C[k][j][i] = A[temp] << q;
+ D[k][j][i] = B[temp] << q;
+ }
+}
diff --git a/gcc/timevar.def b/gcc/timevar.def
index a28d6ba..86e2999 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -146,6 +146,7 @@ DEFTIMEVAR (TV_COMPLETE_UNROLL , "complete unrolling")
DEFTIMEVAR (TV_TREE_PARALLELIZE_LOOPS, "tree parallelize loops")
DEFTIMEVAR (TV_TREE_VECTORIZATION , "tree vectorization")
DEFTIMEVAR (TV_TREE_SLP_VECTORIZATION, "tree slp vectorization")
+DEFTIMEVAR (TV_GRAPHITE , "Graphite")
DEFTIMEVAR (TV_GRAPHITE_TRANSFORMS , "Graphite loop transforms")
DEFTIMEVAR (TV_GRAPHITE_DATA_DEPS , "Graphite data dep analysis")
DEFTIMEVAR (TV_GRAPHITE_CODE_GEN , "Graphite code generation")
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 33c898e..84d4a88 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -373,6 +373,7 @@ extern struct gimple_opt_pass pass_iv_canon;
extern struct gimple_opt_pass pass_scev_cprop;
extern struct gimple_opt_pass pass_empty_loop;
extern struct gimple_opt_pass pass_record_bounds;
+extern struct gimple_opt_pass pass_graphite;
extern struct gimple_opt_pass pass_graphite_transforms;
extern struct gimple_opt_pass pass_if_conversion;
extern struct gimple_opt_pass pass_loop_distribution;
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 7a60144..9523dab 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -310,6 +310,25 @@ gate_graphite_transforms (void)
return flag_graphite != 0;
}
+struct gimple_opt_pass pass_graphite =
+{
+ {
+ GIMPLE_PASS,
+ "graphite0", /* name */
+ gate_graphite_transforms, /* gate */
+ NULL, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_GRAPHITE, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0 /* todo_flags_finish */
+ }
+};
+
struct gimple_opt_pass pass_graphite_transforms =
{
{
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 13/65] Remove insert_copyout and insert_copyin.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (15 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 18/65] Split rewrite_cross_bb_scalar_deps_out_of_ssa out from rewrite_reductions_out_of_ssa Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 19/65] Always insert out of SSA copies on edges except for loop->latch Sebastian Pop
` (50 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (insert_out_of_ssa_copy): Pass an extra
argument for the place after which to insert the out of SSA copy.
(rewrite_close_phi_out_of_ssa): Update calls to insert_out_of_ssa_copy.
(rewrite_phi_out_of_ssa): Same.
(rewrite_cross_bb_scalar_deps): Same.
(insert_copyout): Removed.
(insert_copyin): Removed.
(translate_scalar_reduction_to_array): Call insert_out_of_ssa_copy and
insert_out_of_ssa_copy_on_edge instead of insert_copyout and
insert_copyin.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160652 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 13 ++++++++++
gcc/ChangeLog.graphite | 13 ++++++++++
gcc/graphite-sese-to-poly.c | 53 ++++++++++++------------------------------
3 files changed, 41 insertions(+), 38 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f2f9d17..2985acb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,18 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (insert_out_of_ssa_copy): Pass an extra
+ argument for the place after which to insert the out of SSA copy.
+ (rewrite_close_phi_out_of_ssa): Update calls to insert_out_of_ssa_copy.
+ (rewrite_phi_out_of_ssa): Same.
+ (rewrite_cross_bb_scalar_deps): Same.
+ (insert_copyout): Removed.
+ (insert_copyin): Removed.
+ (translate_scalar_reduction_to_array): Call insert_out_of_ssa_copy and
+ insert_out_of_ssa_copy_on_edge instead of insert_copyout and
+ insert_copyin.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (build_scop_bbs): Not static anymore.
(rewrite_reductions_out_of_ssa): Same.
(rewrite_commutative_reductions_out_of_ssa): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c74fce0..72c1876 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,18 @@
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (insert_out_of_ssa_copy): Pass an extra
+ argument for the place after which to insert the out of SSA copy.
+ (rewrite_close_phi_out_of_ssa): Update calls to insert_out_of_ssa_copy.
+ (rewrite_phi_out_of_ssa): Same.
+ (rewrite_cross_bb_scalar_deps): Same.
+ (insert_copyout): Removed.
+ (insert_copyin): Removed.
+ (translate_scalar_reduction_to_array): Call insert_out_of_ssa_copy and
+ insert_out_of_ssa_copy_on_edge instead of insert_copyout and
+ insert_copyin.
+
+2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (build_scop_bbs): Not static anymore.
(rewrite_reductions_out_of_ssa): Same.
(rewrite_commutative_reductions_out_of_ssa): Same.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 969ef2b..2897cd6 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2117,10 +2117,10 @@ gsi_for_phi_node (gimple stmt)
return psi;
}
-/* Insert the assignment "RES := VAR" just after the definition of VAR. */
+/* Insert the assignment "RES := VAR" just after AFTER_STMT. */
static void
-insert_out_of_ssa_copy (tree res, tree var)
+insert_out_of_ssa_copy (tree res, tree var, gimple after_stmt)
{
gimple stmt;
gimple_seq stmts;
@@ -2134,15 +2134,14 @@ insert_out_of_ssa_copy (tree res, tree var)
si = gsi_last (stmts);
gsi_insert_after (&si, stmt, GSI_NEW_STMT);
- stmt = SSA_NAME_DEF_STMT (var);
- if (gimple_code (stmt) == GIMPLE_PHI)
+ if (gimple_code (after_stmt) == GIMPLE_PHI)
{
- gsi = gsi_after_labels (gimple_bb (stmt));
+ gsi = gsi_after_labels (gimple_bb (after_stmt));
gsi_insert_seq_before (&gsi, stmts, GSI_NEW_STMT);
}
else
{
- gsi = gsi_for_stmt (stmt);
+ gsi = gsi_for_stmt (after_stmt);
gsi_insert_seq_after (&gsi, stmts, GSI_NEW_STMT);
}
}
@@ -2218,7 +2217,7 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
if (TREE_CODE (arg) == SSA_NAME
&& !SSA_NAME_IS_DEFAULT_DEF (arg))
- insert_out_of_ssa_copy (zero_dim_array, arg);
+ insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
else
insert_out_of_ssa_copy_on_edge (single_pred_edge (gimple_bb (phi)),
zero_dim_array, arg);
@@ -2239,7 +2238,7 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi)
basic_block bb = gimple_bb (phi);
tree res = gimple_phi_result (phi);
tree var = SSA_NAME_VAR (res);
- tree zero_dim_array = create_zero_dim_array (var, "General_Reduction");
+ tree zero_dim_array = create_zero_dim_array (var, "phi_out_of_ssa");
gimple_stmt_iterator gsi;
gimple stmt;
gimple_seq stmts;
@@ -2295,7 +2294,7 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi)
gimple_bb (SSA_NAME_DEF_STMT (arg)))
|| flow_bb_inside_loop_p (loop_outer (bb->loop_father),
gimple_bb (SSA_NAME_DEF_STMT (arg)))))
- insert_out_of_ssa_copy (zero_dim_array, arg);
+ insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
else
insert_out_of_ssa_copy_on_edge (gimple_phi_arg_edge (phi, i),
zero_dim_array, arg);
@@ -2389,7 +2388,8 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
{
zero_dim_array = create_zero_dim_array
(SSA_NAME_VAR (def), "Cross_BB_scalar_dependence");
- insert_out_of_ssa_copy (zero_dim_array, def);
+ insert_out_of_ssa_copy (zero_dim_array, def,
+ SSA_NAME_DEF_STMT (def));
gsi_next (gsi);
}
@@ -2728,32 +2728,6 @@ translate_scalar_reduction_to_array_for_stmt (tree red, gimple stmt,
gsi_insert_after (&insert_gsi, assign, GSI_SAME_STMT);
}
-/* Insert the assignment "result (CLOSE_PHI) = RED". */
-
-static void
-insert_copyout (tree red, gimple close_phi)
-{
- tree res = gimple_phi_result (close_phi);
- basic_block bb = gimple_bb (close_phi);
- gimple_stmt_iterator insert_gsi = gsi_after_labels (bb);
- gimple assign = gimple_build_assign (res, red);
-
- gsi_insert_before (&insert_gsi, assign, GSI_SAME_STMT);
-}
-
-/* Insert the assignment "RED = initial_value (LOOP_PHI)". */
-
-static void
-insert_copyin (tree red, gimple loop_phi)
-{
- gimple_seq stmts;
- tree init = initial_value_for_loop_phi (loop_phi);
- tree expr = build2 (MODIFY_EXPR, TREE_TYPE (init), red, init);
-
- force_gimple_operand (expr, &stmts, true, NULL);
- gsi_insert_seq_on_edge (edge_initial_value_for_loop_phi (loop_phi), stmts);
-}
-
/* Removes the PHI node and resets all the debug stmts that are using
the PHI_RESULT. */
@@ -2829,8 +2803,11 @@ translate_scalar_reduction_to_array (VEC (gimple, heap) *in,
if (i == VEC_length (gimple, in) - 1)
{
- insert_copyout (red, close_phi);
- insert_copyin (red, loop_phi);
+ insert_out_of_ssa_copy (gimple_phi_result (close_phi), red,
+ close_phi);
+ insert_out_of_ssa_copy_on_edge
+ (edge_initial_value_for_loop_phi (loop_phi),
+ red, initial_value_for_loop_phi (loop_phi));
}
remove_phi (loop_phi);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 12/65] Detect commutative reductions in all the scops before rewriting out of SSA all the other scalar dependences.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (10 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 17/65] Add more debug counter guards Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 15/65] Remove rename_nb_iterations and rename_sese_parameters Sebastian Pop
` (55 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (build_scop_bbs): Not static anymore.
(rewrite_reductions_out_of_ssa): Same.
(rewrite_commutative_reductions_out_of_ssa): Same.
(build_poly_scop): Do not call these functions.
* graphite-sese-to-poly.h (build_poly_scop): Declared.
(rewrite_reductions_out_of_ssa): Declared.
(rewrite_commutative_reductions_out_of_ssa): Declared.
* graphite.c (graphite_transform_loops): Call on every scop
rewrite_commutative_reductions_out_of_ssa before calling
rewrite_reductions_out_of_ssa and build_scop_bbs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160651 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 13 +++++++++++++
gcc/ChangeLog.graphite | 13 +++++++++++++
gcc/graphite-sese-to-poly.c | 16 +++++-----------
gcc/graphite-sese-to-poly.h | 3 +++
gcc/graphite.c | 14 ++++++++++++++
5 files changed, 48 insertions(+), 11 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0d68719..f2f9d17 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,18 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (build_scop_bbs): Not static anymore.
+ (rewrite_reductions_out_of_ssa): Same.
+ (rewrite_commutative_reductions_out_of_ssa): Same.
+ (build_poly_scop): Do not call these functions.
+ * graphite-sese-to-poly.h (build_poly_scop): Declared.
+ (rewrite_reductions_out_of_ssa): Declared.
+ (rewrite_commutative_reductions_out_of_ssa): Declared.
+ * graphite.c (graphite_transform_loops): Call on every scop
+ rewrite_commutative_reductions_out_of_ssa before calling
+ rewrite_reductions_out_of_ssa and build_scop_bbs.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-dependences.c (dot_deps): Make system call to dotty run
in background.
(dot_deps_stmt): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 2e04618..c74fce0 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,18 @@
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (build_scop_bbs): Not static anymore.
+ (rewrite_reductions_out_of_ssa): Same.
+ (rewrite_commutative_reductions_out_of_ssa): Same.
+ (build_poly_scop): Do not call these functions.
+ * graphite-sese-to-poly.h (build_poly_scop): Declared.
+ (rewrite_reductions_out_of_ssa): Declared.
+ (rewrite_commutative_reductions_out_of_ssa): Declared.
+ * graphite.c (graphite_transform_loops): Call on every scop
+ rewrite_commutative_reductions_out_of_ssa before calling
+ rewrite_reductions_out_of_ssa and build_scop_bbs.
+
+2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-dependences.c (dot_deps): Make system call to dotty run
in background.
(dot_deps_stmt): Same.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 68cb2a4..969ef2b 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -462,7 +462,7 @@ build_scop_bbs_1 (scop_p scop, sbitmap visited, basic_block bb, sbitmap reductio
/* Gather the basic blocks belonging to the SCOP. */
-static void
+void
build_scop_bbs (scop_p scop, sbitmap reductions)
{
sbitmap visited = sbitmap_alloc (last_basic_block);
@@ -2399,7 +2399,7 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
/* Rewrite out of SSA all the reduction phi nodes of SCOP. */
-static void
+void
rewrite_reductions_out_of_ssa (scop_p scop)
{
basic_block bb;
@@ -2578,7 +2578,7 @@ detect_commutative_reduction_arg (tree lhs, gimple stmt, tree arg,
}
/* Detect commutative and associative scalar reductions starting at
- the STMT. Return the phi node of the reduction cycle, or NULL. */
+ STMT. Return the phi node of the reduction cycle, or NULL. */
static gimple
detect_commutative_reduction_assign (gimple stmt, VEC (gimple, heap) **in,
@@ -2666,7 +2666,7 @@ initial_value_for_loop_phi (gimple phi)
}
/* Detect commutative and associative scalar reductions starting at
- the loop closed phi node CLOSE_PHI. Return the phi node of the
+ the loop closed phi node STMT. Return the phi node of the
reduction cycle, or NULL. */
static gimple
@@ -2874,7 +2874,7 @@ rewrite_commutative_reductions_out_of_ssa_loop (loop_p loop,
/* Rewrites all the commutative reductions from SCOP out of SSA. */
-static void
+void
rewrite_commutative_reductions_out_of_ssa (sese region, sbitmap reductions)
{
loop_iterator li;
@@ -2973,14 +2973,8 @@ void
build_poly_scop (scop_p scop)
{
sese region = SCOP_REGION (scop);
- sbitmap reductions = sbitmap_alloc (last_basic_block * 2);
graphite_dim_t max_dim;
- sbitmap_zero (reductions);
- rewrite_commutative_reductions_out_of_ssa (region, reductions);
- rewrite_reductions_out_of_ssa (scop);
- build_scop_bbs (scop, reductions);
- sbitmap_free (reductions);
/* FIXME: This restriction is needed to avoid a problem in CLooG.
Once CLooG is fixed, remove this guard. Anyways, it makes no
diff --git a/gcc/graphite-sese-to-poly.h b/gcc/graphite-sese-to-poly.h
index ccf36dd..2e0cc08 100644
--- a/gcc/graphite-sese-to-poly.h
+++ b/gcc/graphite-sese-to-poly.h
@@ -30,5 +30,8 @@ struct base_alias_pair
void build_poly_scop (scop_p);
void check_poly_representation (scop_p);
+void rewrite_commutative_reductions_out_of_ssa (sese, sbitmap);
+void rewrite_reductions_out_of_ssa (scop_p);
+void build_scop_bbs (scop_p, sbitmap);
#endif
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 2933d21..bd47cf7 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -253,6 +253,7 @@ graphite_transform_loops (void)
bool need_cfg_cleanup_p = false;
VEC (scop_p, heap) *scops = NULL;
htab_t bb_pbb_mapping;
+ sbitmap reductions;
if (!graphite_initialize ())
return;
@@ -266,6 +267,19 @@ graphite_transform_loops (void)
}
bb_pbb_mapping = htab_create (10, bb_pbb_map_hash, eq_bb_pbb_map, free);
+ reductions = sbitmap_alloc (last_basic_block * 2);
+ sbitmap_zero (reductions);
+
+ for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ rewrite_commutative_reductions_out_of_ssa (SCOP_REGION (scop), reductions);
+
+ for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+ {
+ rewrite_reductions_out_of_ssa (scop);
+ build_scop_bbs (scop, reductions);
+ }
+
+ sbitmap_free (reductions);
for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
build_poly_scop (scop);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 04/65] Add analysis pass to build the refined program structure tree.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (12 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 15/65] Remove rename_nb_iterations and rename_sese_parameters Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 14/65] Also rewrite out of SSA scalar dependences going outside the SCoP region Sebastian Pop
` (53 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
The hash table utility functions are copied and adapted from code
Antoniu contributed.
2010-05-27 Tobias Grosser <grosser@fim.uni-passau.de>
Antoniu Pop <antoniu.pop@gmail.com>
* Makefile.in (OBJS-common): Add refined-regions.o.
(refined-regions.o): New.
(graphite-scop-detection.o): Use refined-regions.h.
* graphite-scop-detection.c: Include refined-regions.h
(build_scops): Also build the refined region tree.
* refined-regions.c: New. Adds an algorithm to detect refined
regions.
(print_refined_region): New.
(debug_refined_region): New.
(refined_region_contains_bb_p): New.
(refined_region_contains_region_p): New.
(is_common_df): New.
(struct find_regions_global_data): New.
(is_region): New.
(typedef struct bb_bb_def): New.
(new_bb_bb_def): New.
(bb_bb_map_hash): New.
(eq_bb_bb_map): New.
(find_new_bb): New.
(bb_reg_def): New.
(new_bb_reg_def): New.
(bb_reg_map_hash): New.
(eq_bb_reg_map): New.
(find_new_region): New.
(insert_new_reg): New.
(insert_new_bb): New.
(insert_shortcut): New.
(get_next_postdom): New.
(create_region): New.
(find_regions_with_entry): New.
(find_regions_adc): New.
(find_regions): New.
(get_topmost_parent): New.
(build_regions_tree): New.
(calculate_region_tree): New.
(free_region_tree): New.
* refined-regions.h: New.
(struct refined_region): New.
(calculate_region_tree): New.
(free_region_tree): New.
(refined_region_contains_bb_p): New.
(refined_region_contains_region_p): New.
(print_refined_region): New.
(debug_refined_region): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@159932 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 48 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 6341a15..5fe8322 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,51 @@
+2010-05-27 Tobias Grosser <grosser@fim.uni-passau.de>
+ Antoniu Pop <antoniu.pop@gmail.com>
+
+ * Makefile.in (OBJS-common): Add refined-regions.o.
+ (refined-regions.o): New.
+ (graphite-scop-detection.o): Use refined-regions.h.
+ * graphite-scop-detection.c: Include refined-regions.h
+ (build_scops): Also build the refined region tree.
+ * refined-regions.c: New. Adds an algorithm to detect refined
+ regions.
+ (print_refined_region): New.
+ (debug_refined_region): New.
+ (refined_region_contains_bb_p): New.
+ (refined_region_contains_region_p): New.
+ (is_common_df): New.
+ (struct find_regions_global_data): New.
+ (is_region): New.
+ (typedef struct bb_bb_def): New.
+ (new_bb_bb_def): New.
+ (bb_bb_map_hash): New.
+ (eq_bb_bb_map): New.
+ (find_new_bb): New.
+ (bb_reg_def): New.
+ (new_bb_reg_def): New.
+ (bb_reg_map_hash): New.
+ (eq_bb_reg_map): New.
+ (find_new_region): New.
+ (insert_new_reg): New.
+ (insert_new_bb): New.
+ (insert_shortcut): New.
+ (get_next_postdom): New.
+ (create_region): New.
+ (find_regions_with_entry): New.
+ (find_regions_adc): New.
+ (find_regions): New.
+ (get_topmost_parent): New.
+ (build_regions_tree): New.
+ (calculate_region_tree): New.
+ (free_region_tree): New.
+ * refined-regions.h: New.
+ (struct refined_region): New.
+ (calculate_region_tree): New.
+ (free_region_tree): New.
+ (refined_region_contains_bb_p): New.
+ (refined_region_contains_region_p): New.
+ (print_refined_region): New.
+ (debug_refined_region): New.
+
2010-05-26 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (graphite_create_new_loop_guard): Use
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 14/65] Also rewrite out of SSA scalar dependences going outside the SCoP region.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (13 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 04/65] Add analysis pass to build the refined program structure tree Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-11-10 12:23 ` H.J. Lu
2010-08-02 20:22 ` [PATCH 18/65] Split rewrite_cross_bb_scalar_deps_out_of_ssa out from rewrite_reductions_out_of_ssa Sebastian Pop
` (52 subsequent siblings)
67 siblings, 1 reply; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (gloog): Remove call to
sese_adjust_liveout_phis.
* graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an
SSA_NAME, allow it to be handled by rewrite_cross_bb_scalar_deps.
(rewrite_cross_bb_scalar_deps): Handle GIMPLE_PHI nodes: call
rewrite_phi_out_of_ssa.
* sese.c (get_vdef_before_sese): Removed.
(sese_adjust_vphi): Removed.
(sese_adjust_liveout_phis): Removed.
* sese.h (sese_adjust_liveout_phis): Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160653 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 13 +++
gcc/ChangeLog.graphite | 13 +++
gcc/graphite-clast-to-gimple.c | 4 -
gcc/graphite-sese-to-poly.c | 13 ++-
gcc/sese.c | 159 ----------------------------------------
gcc/sese.h | 1 -
6 files changed, 35 insertions(+), 168 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2985acb..370b42f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,18 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (gloog): Remove call to
+ sese_adjust_liveout_phis.
+ * graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an
+ SSA_NAME, allow it to be handled by rewrite_cross_bb_scalar_deps.
+ (rewrite_cross_bb_scalar_deps): Handle GIMPLE_PHI nodes: call
+ rewrite_phi_out_of_ssa.
+ * sese.c (get_vdef_before_sese): Removed.
+ (sese_adjust_vphi): Removed.
+ (sese_adjust_liveout_phis): Removed.
+ * sese.h (sese_adjust_liveout_phis): Removed.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (insert_out_of_ssa_copy): Pass an extra
argument for the place after which to insert the out of SSA copy.
(rewrite_close_phi_out_of_ssa): Update calls to insert_out_of_ssa_copy.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 72c1876..2c0a3c1 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,18 @@
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (gloog): Remove call to
+ sese_adjust_liveout_phis.
+ * graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an
+ SSA_NAME, allow it to be handled by rewrite_cross_bb_scalar_deps.
+ (rewrite_cross_bb_scalar_deps): Handle GIMPLE_PHI nodes: call
+ rewrite_phi_out_of_ssa.
+ * sese.c (get_vdef_before_sese): Removed.
+ (sese_adjust_vphi): Removed.
+ (sese_adjust_liveout_phis): Removed.
+ * sese.h (sese_adjust_liveout_phis): Removed.
+
+2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (insert_out_of_ssa_copy): Pass an extra
argument for the place after which to insert the out of SSA copy.
(rewrite_close_phi_out_of_ssa): Update calls to insert_out_of_ssa_copy.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index b6b8d31..859bedf 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1576,10 +1576,6 @@ gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping)
rename_map, &newivs, newivs_index,
bb_pbb_mapping, 1, params_index);
graphite_verify ();
- sese_adjust_liveout_phis (region, rename_map,
- if_region->region->exit->src,
- if_region->false_region->exit,
- if_region->true_region->exit);
scev_reset_htab ();
rename_nb_iterations (rename_map);
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 2897cd6..8baf379 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2326,7 +2326,8 @@ scev_analyzable_p (tree def, sese region)
loop_p loop = loop_containing_stmt (stmt);
tree scev = scalar_evolution_in_region (region, loop, def);
- return !chrec_contains_undetermined (scev);
+ return !chrec_contains_undetermined (scev)
+ && TREE_CODE (scev) != SSA_NAME;
}
/* Rewrite the scalar dependence of DEF used in USE_STMT with a memory
@@ -2380,9 +2381,13 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
def_bb = gimple_bb (stmt);
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
- if (def_bb != gimple_bb (use_stmt)
- && gimple_code (use_stmt) != GIMPLE_PHI
- && !is_gimple_debug (use_stmt))
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
+ {
+ gimple_stmt_iterator si = gsi_for_stmt (use_stmt);
+ rewrite_phi_out_of_ssa (&si);
+ }
+ else if (def_bb != gimple_bb (use_stmt)
+ && !is_gimple_debug (use_stmt))
{
if (!zero_dim_array)
{
diff --git a/gcc/sese.c b/gcc/sese.c
index 2ed6485..0a6c45d 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -394,100 +394,6 @@ sese_insert_phis_for_liveouts (sese region, basic_block bb,
update_ssa (TODO_update_ssa);
}
-/* Get the definition of NAME before the SESE. Keep track of the
- basic blocks that have been VISITED in a bitmap. */
-
-static tree
-get_vdef_before_sese (sese region, tree name, sbitmap visited)
-{
- unsigned i;
- gimple stmt = SSA_NAME_DEF_STMT (name);
- basic_block def_bb = gimple_bb (stmt);
-
- if (!def_bb || !bb_in_sese_p (def_bb, region))
- return name;
-
- if (TEST_BIT (visited, def_bb->index))
- return NULL_TREE;
-
- SET_BIT (visited, def_bb->index);
-
- switch (gimple_code (stmt))
- {
- case GIMPLE_PHI:
- for (i = 0; i < gimple_phi_num_args (stmt); i++)
- {
- tree arg = gimple_phi_arg_def (stmt, i);
- tree res;
-
- if (gimple_bb (SSA_NAME_DEF_STMT (arg))
- && def_bb->index == gimple_bb (SSA_NAME_DEF_STMT (arg))->index)
- continue;
-
- res = get_vdef_before_sese (region, arg, visited);
- if (res)
- return res;
- }
- return NULL_TREE;
-
- case GIMPLE_ASSIGN:
- case GIMPLE_CALL:
- {
- use_operand_p use_p = gimple_vuse_op (stmt);
- tree use = USE_FROM_PTR (use_p);
-
- if (def_bb->index == gimple_bb (SSA_NAME_DEF_STMT (use))->index)
- RESET_BIT (visited, def_bb->index);
-
- return get_vdef_before_sese (region, use, visited);
- }
-
- default:
- return NULL_TREE;
- }
-}
-
-/* Adjust a virtual phi node PHI that is placed at the end of the
- generated code for SCOP:
-
- | if (1)
- | generated code from REGION;
- | else
- | REGION;
-
- The FALSE_E edge comes from the original code, TRUE_E edge comes
- from the code generated for the SCOP. */
-
-static void
-sese_adjust_vphi (sese region, gimple phi, edge true_e)
-{
- unsigned i;
-
- gcc_assert (gimple_phi_num_args (phi) == 2);
-
- for (i = 0; i < gimple_phi_num_args (phi); i++)
- if (gimple_phi_arg_edge (phi, i) == true_e)
- {
- tree true_arg, false_arg, before_scop_arg;
- sbitmap visited;
-
- true_arg = gimple_phi_arg_def (phi, i);
- if (!SSA_NAME_IS_DEFAULT_DEF (true_arg))
- return;
-
- false_arg = gimple_phi_arg_def (phi, i == 0 ? 1 : 0);
- if (SSA_NAME_IS_DEFAULT_DEF (false_arg))
- return;
-
- visited = sbitmap_alloc (last_basic_block);
- sbitmap_zero (visited);
- before_scop_arg = get_vdef_before_sese (region, false_arg, visited);
- gcc_assert (before_scop_arg != NULL_TREE);
- SET_PHI_ARG_DEF (phi, i, before_scop_arg);
- sbitmap_free (visited);
- }
-}
-
/* Returns the expression associated to OLD_NAME in MAP. */
static tree
@@ -585,71 +491,6 @@ rename_sese_parameters (htab_t rename_map, sese region)
rename_variables_in_expr (rename_map, p));
}
-/* Adjusts the phi nodes in the block BB for variables defined in
- SCOP_REGION and used outside the SCOP_REGION. The code generation
- moves SCOP_REGION in the else clause of an "if (1)" and generates
- code in the then clause:
-
- | if (1)
- | generated code from REGION;
- | else
- | REGION;
-
- To adjust the phi nodes after the condition, the RENAME_MAP is
- used. */
-
-void
-sese_adjust_liveout_phis (sese region, htab_t rename_map, basic_block bb,
- edge false_e, edge true_e)
-{
- gimple_stmt_iterator si;
-
- for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
- {
- unsigned i;
- unsigned false_i = 0;
- gimple phi = gsi_stmt (si);
- tree res = gimple_phi_result (phi);
-
- if (!is_gimple_reg (res))
- {
- sese_adjust_vphi (region, phi, true_e);
- continue;
- }
-
- for (i = 0; i < gimple_phi_num_args (phi); i++)
- if (gimple_phi_arg_edge (phi, i) == false_e)
- {
- false_i = i;
- break;
- }
-
- for (i = 0; i < gimple_phi_num_args (phi); i++)
- if (gimple_phi_arg_edge (phi, i) == true_e)
- {
- tree old_name = gimple_phi_arg_def (phi, false_i);
- tree expr = get_rename (rename_map, old_name);
- gimple_seq stmts;
-
- gcc_assert (old_name != expr);
-
- if (TREE_CODE (expr) != SSA_NAME
- && is_gimple_reg (old_name))
- {
- tree type = TREE_TYPE (old_name);
- tree var = create_tmp_var (type, "var");
-
- expr = build2 (MODIFY_EXPR, type, var, expr);
- expr = force_gimple_operand (expr, &stmts, true, NULL);
- gsi_insert_seq_on_edge_immediate (true_e, stmts);
- }
-
- SET_PHI_ARG_DEF (phi, i, expr);
- set_rename (rename_map, old_name, res);
- }
- }
-}
-
/* Rename the SSA_NAMEs used in STMT and that appear in MAP. */
static void
diff --git a/gcc/sese.h b/gcc/sese.h
index 2b05ca8..4b2e5c2 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -55,7 +55,6 @@ typedef struct sese_s
extern sese new_sese (edge, edge);
extern void free_sese (sese);
extern void sese_insert_phis_for_liveouts (sese, basic_block, edge, edge);
-extern void sese_adjust_liveout_phis (sese, htab_t, basic_block, edge, edge);
extern void build_sese_loop_nests (sese);
extern edge copy_bb_and_scalar_dependences (basic_block, sese, edge, htab_t);
extern struct loop *outermost_loop_in_sese (sese, basic_block);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 15/65] Remove rename_nb_iterations and rename_sese_parameters
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (11 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 12/65] Detect commutative reductions in all the scops before rewriting out of SSA all the other scalar dependences Sebastian Pop
@ 2010-08-02 20:22 ` Sebastian Pop
2010-08-02 20:22 ` [PATCH 04/65] Add analysis pass to build the refined program structure tree Sebastian Pop
` (54 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:22 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter.
Remove calls to rename_nb_iterations and rename_sese_parameters.
* graphite-clast-to-gimple.h (gloog): Update declaration.
* graphite.c (graphite_transform_loops): Update call to gloog.
* sese.c (rename_variables_in_expr): Removed.
(rename_nb_iterations): Removed.
(rename_sese_parameters): Removed.
* sese.h (rename_nb_iterations): Removed.
(rename_sese_parameters): Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160657 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 12 ++++++++
gcc/ChangeLog.graphite | 12 ++++++++
gcc/graphite-clast-to-gimple.c | 8 +-----
gcc/graphite-clast-to-gimple.h | 2 +-
gcc/graphite.c | 2 +-
gcc/sese.c | 56 ----------------------------------------
gcc/sese.h | 2 -
7 files changed, 27 insertions(+), 67 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 370b42f..d05f124 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,17 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter.
+ Remove calls to rename_nb_iterations and rename_sese_parameters.
+ * graphite-clast-to-gimple.h (gloog): Update declaration.
+ * graphite.c (graphite_transform_loops): Update call to gloog.
+ * sese.c (rename_variables_in_expr): Removed.
+ (rename_nb_iterations): Removed.
+ (rename_sese_parameters): Removed.
+ * sese.h (rename_nb_iterations): Removed.
+ (rename_sese_parameters): Removed.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (gloog): Remove call to
sese_adjust_liveout_phis.
* graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 2c0a3c1..aac1c96 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,17 @@
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter.
+ Remove calls to rename_nb_iterations and rename_sese_parameters.
+ * graphite-clast-to-gimple.h (gloog): Update declaration.
+ * graphite.c (graphite_transform_loops): Update call to gloog.
+ * sese.c (rename_variables_in_expr): Removed.
+ (rename_nb_iterations): Removed.
+ (rename_sese_parameters): Removed.
+ * sese.h (rename_nb_iterations): Removed.
+ (rename_sese_parameters): Removed.
+
+2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (gloog): Remove call to
sese_adjust_liveout_phis.
* graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 859bedf..8b972b8 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1529,7 +1529,7 @@ create_params_index (htab_t index_table, CloogProgram *prog) {
*/
bool
-gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping)
+gloog (scop_p scop, htab_t bb_pbb_mapping)
{
VEC (tree, heap) *newivs = VEC_alloc (tree, heap, 10);
loop_p context_loop;
@@ -1537,7 +1537,6 @@ gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping)
ifsese if_region = NULL;
htab_t rename_map, newivs_index, params_index;
cloog_prog_clast pc;
- int i;
timevar_push (TV_GRAPHITE_CODE_GEN);
gloog_error = false;
@@ -1577,11 +1576,6 @@ gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping)
bb_pbb_mapping, 1, params_index);
graphite_verify ();
scev_reset_htab ();
- rename_nb_iterations (rename_map);
-
- for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
- rename_sese_parameters (rename_map, SCOP_REGION (scop));
-
recompute_all_dominators ();
graphite_verify ();
diff --git a/gcc/graphite-clast-to-gimple.h b/gcc/graphite-clast-to-gimple.h
index f6557f6..c90cfc0 100644
--- a/gcc/graphite-clast-to-gimple.h
+++ b/gcc/graphite-clast-to-gimple.h
@@ -36,7 +36,7 @@ typedef struct bb_pbb_def
poly_bb_p pbb;
}bb_pbb_def;
-extern bool gloog (scop_p, VEC (scop_p, heap) *, htab_t);
+extern bool gloog (scop_p, htab_t);
extern cloog_prog_clast scop_to_clast (scop_p);
extern void debug_clast_stmt (struct clast_stmt *);
extern void print_clast_stmt (FILE *, struct clast_stmt *);
diff --git a/gcc/graphite.c b/gcc/graphite.c
index bd47cf7..c4fd2a3 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -287,7 +287,7 @@ graphite_transform_loops (void)
for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
if (POLY_SCOP_P (scop)
&& apply_poly_transforms (scop)
- && gloog (scop, scops, bb_pbb_mapping))
+ && gloog (scop, bb_pbb_mapping))
need_cfg_cleanup_p = true;
htab_delete (bb_pbb_mapping);
diff --git a/gcc/sese.c b/gcc/sese.c
index 0a6c45d..8f6b7d7 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -435,62 +435,6 @@ set_rename (htab_t map, tree old_name, tree expr)
*slot = new_rename_map_elt (old_name, expr);
}
-/* Renames the expression T following the tuples (OLD_NAME, EXPR) in
- the rename map M. Returns the expression T after renaming. */
-
-static tree
-rename_variables_in_expr (htab_t m, tree t)
-{
- if (!t)
- return t;
-
- if (TREE_CODE (t) == SSA_NAME)
- return get_rename (m, t);
-
- switch (TREE_CODE_LENGTH (TREE_CODE (t)))
- {
- case 3:
- TREE_OPERAND (t, 2) = rename_variables_in_expr (m, TREE_OPERAND (t, 2));
-
- case 2:
- TREE_OPERAND (t, 1) = rename_variables_in_expr (m, TREE_OPERAND (t, 1));
-
- case 1:
- TREE_OPERAND (t, 0) = rename_variables_in_expr (m, TREE_OPERAND (t, 0));
-
- default:
- return t;
- }
-}
-
-/* Renames all the loop->nb_iterations expressions following the
- tuples (OLD_NAME, EXPR) in RENAME_MAP. */
-
-void
-rename_nb_iterations (htab_t rename_map)
-{
- loop_iterator li;
- struct loop *loop;
-
- FOR_EACH_LOOP (li, loop, 0)
- loop->nb_iterations = rename_variables_in_expr (rename_map,
- loop->nb_iterations);
-}
-
-/* Renames all the parameters of SESE following the tuples (OLD_NAME,
- EXPR) in RENAME_MAP. */
-
-void
-rename_sese_parameters (htab_t rename_map, sese region)
-{
- int i;
- tree p;
-
- for (i = 0; VEC_iterate (tree, SESE_PARAMS (region), i, p); i++)
- VEC_replace (tree, SESE_PARAMS (region), i,
- rename_variables_in_expr (rename_map, p));
-}
-
/* Rename the SSA_NAMEs used in STMT and that appear in MAP. */
static void
diff --git a/gcc/sese.h b/gcc/sese.h
index 4b2e5c2..d0d829f 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -262,8 +262,6 @@ extern void debug_rename_map (htab_t);
extern hashval_t rename_map_elt_info (const void *);
extern int eq_rename_map_elts (const void *, const void *);
extern void set_rename (htab_t, tree, tree);
-extern void rename_nb_iterations (htab_t);
-extern void rename_sese_parameters (htab_t, sese);
/* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW. */
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 25/65] Remove dead code.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (22 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 20/65] Fix testcase: call abort Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 32/65] Add testcase for miscompile in gamess Sebastian Pop
` (43 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161358 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 4 ++++
gcc/ChangeLog.graphite | 4 ++++
gcc/graphite-sese-to-poly.c | 3 ---
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 183050a..95b5413 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (build_iv_mapping): Rename map with
rename_map.
* sese.c (debug_rename_map): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 3b04837..c2be7c7 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,9 @@
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code.
+
+2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (build_iv_mapping): Rename map with
rename_map.
* sese.c (debug_rename_map): Same.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 5f99f65..318401e 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2348,7 +2348,6 @@ rewrite_cross_bb_phi_deps (sese region, gimple_stmt_iterator gsi)
gimple stmt = gsi_stmt (gsi);
imm_use_iterator imm_iter;
tree def;
- basic_block def_bb;
gimple use_stmt;
if (gimple_code (stmt) != GIMPLE_ASSIGN)
@@ -2359,8 +2358,6 @@ rewrite_cross_bb_phi_deps (sese region, gimple_stmt_iterator gsi)
|| scev_analyzable_p (def, region))
return;
- def_bb = gimple_bb (stmt);
-
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
if (gimple_code (use_stmt) == GIMPLE_PHI)
{
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 30/65] Move cloog-related functions from graphite-ppl.{c,h} to new graphite-cloog-util.{c,h}.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (29 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 28/65] Print bbs in refined region tree Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 24/65] Replace map with rename_map Sebastian Pop
` (36 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-05 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* Makefile.in
(OBJS-common): Added graphite-cloog-util.o.
(graphite-clast-to-gimple.o): Added graphite-cloog-util.h.
(graphite-cloog-util.o): New.
(graphite-ppl.o): Added graphite-cloog-util.h.
* graphite-clast-to-gimple.c:
Added graphite-cloog-util.h to include statements.
* graphite-cloog-util.c: New.
(new_Cloog_Matrix_from_ppl_Polyhedron): Moved from graphite-ppl.c.
(new_Cloog_Domain_from_ppl_Polyhedron): Same.
(new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
(new_C_Polyhedron_from_Cloog_Matrix): Same.
(insert_constraint_into_matrix): Same.
(ppl_Constrain_System_number_of_constraints): Same.
(new_Cloog_Matrix_from_ppl_Constraint_System): Same.
(oppose_constraint): Same.
(cloog_matrix_to_ppl_constraint): Same.
(new_Constraint_System_from_Cloog_Matrix): Same.
* graphite-cloog-util.h: New.
(new_Cloog_Matrix_from_ppl_Polyhedron): Moved from graphite-ppl.h.
(new_Cloog_Domain_from_ppl_Polyhedron): Same.
(new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
(new_C_Polyhedron_from_Cloog_Matrix): Same.
(insert_constraint_into_matrix): Same.
* graphite-ppl.c:
Added graphite-cloog-util.h to include statements.
(new_Cloog_Matrix_from_ppl_Polyhedron): Moved to graphite-cloog-util.c.
(new_Cloog_Domain_from_ppl_Polyhedron): Same.
(new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
(new_C_Polyhedron_from_Cloog_Matrix): Same.
(insert_constraint_into_matrix): Same.
(ppl_Constrain_System_number_of_constraints): Same.
(new_Cloog_Matrix_from_ppl_Constraint_System): Same.
(oppose_constraint): Same.
(cloog_matrix_to_ppl_constraint): Same.
(new_Constraint_System_from_Cloog_Matrix): Same.
* graphite-ppl.h:
(new_Cloog_Matrix_from_ppl_Polyhedron): Moved to
graphite-cloog-util.h.
(new_Cloog_Domain_from_ppl_Polyhedron): Same.
(new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
(new_C_Polyhedron_from_Cloog_Matrix): Same.
(insert_constraint_into_matrix): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161864 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 45 +++++++
gcc/ChangeLog.graphite | 46 +++++++
gcc/Makefile.in | 7 +-
gcc/graphite-clast-to-gimple.c | 1 +
gcc/graphite-cloog-util.c | 275 ++++++++++++++++++++++++++++++++++++++++
gcc/graphite-cloog-util.h | 30 +++++
gcc/graphite-ppl.c | 243 +-----------------------------------
gcc/graphite-ppl.h | 6 -
8 files changed, 403 insertions(+), 250 deletions(-)
create mode 100644 gcc/graphite-cloog-util.c
create mode 100644 gcc/graphite-cloog-util.h
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 672f765..caf4aa4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,50 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * Makefile.in (OBJS-common): Added graphite-cloog-util.o.
+ (graphite-clast-to-gimple.o): Added graphite-cloog-util.h.
+ (graphite-cloog-util.o): New.
+ (graphite-ppl.o): Added graphite-cloog-util.h.
+ * graphite-clast-to-gimple.c:
+ Added graphite-cloog-util.h to include statements.
+ * graphite-cloog-util.c: New.
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved from graphite-ppl.c.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Same.
+ (ppl_Constrain_System_number_of_constraints): Same.
+ (new_Cloog_Matrix_from_ppl_Constraint_System): Same.
+ (oppose_constraint): Same.
+ (cloog_matrix_to_ppl_constraint): Same.
+ (new_Constraint_System_from_Cloog_Matrix): Same.
+ * graphite-cloog-util.h: New.
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved from graphite-ppl.h.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Same.
+ * graphite-ppl.c:
+ Added graphite-cloog-util.h to include statements.
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved to graphite-cloog-util.c.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Same.
+ (ppl_Constrain_System_number_of_constraints): Same.
+ (new_Cloog_Matrix_from_ppl_Constraint_System): Same.
+ (oppose_constraint): Same.
+ (cloog_matrix_to_ppl_constraint): Same.
+ (new_Constraint_System_from_Cloog_Matrix): Same.
+ * graphite-ppl.h:
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved to
+ graphite-cloog-util.h.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Same.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c
(precision_for_value): Resolve value_* calls to matching mpz_* calls.
(precision_for_interval): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index a589860..b1c1e8e 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,49 @@
+2010-07-05 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * Makefile.in
+ (OBJS-common): Added graphite-cloog-util.o.
+ (graphite-clast-to-gimple.o): Added graphite-cloog-util.h.
+ (graphite-cloog-util.o): New.
+ (graphite-ppl.o): Added graphite-cloog-util.h.
+ * graphite-clast-to-gimple.c:
+ Added graphite-cloog-util.h to include statements.
+ * graphite-cloog-util.c: New.
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved from graphite-ppl.c.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (ppl_Constrain_System_number_of_constraints): Same.
+ (new_Cloog_Matrix_from_ppl_Constraint_System): Same.
+ (oppose_constraint): Same.
+ (cloog_matrix_to_ppl_constraint): Same.
+ (new_Constraint_System_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Same. Declared static.
+ * graphite-cloog-util.h: New.
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved from graphite-ppl.h.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Same.
+ * graphite-ppl.c:
+ Added graphite-cloog-util.h to include statements.
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved to graphite-cloog-util.c.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Same.
+ (ppl_Constrain_System_number_of_constraints): Same.
+ (new_Cloog_Matrix_from_ppl_Constraint_System): Same.
+ (oppose_constraint): Same.
+ (cloog_matrix_to_ppl_constraint): Same.
+ (new_Constraint_System_from_Cloog_Matrix): Same.
+ * graphite-ppl.h:
+ (new_Cloog_Matrix_from_ppl_Polyhedron): Moved to
+ graphite-cloog-util.h.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Same.
+ (new_C_Polyhedron_from_Cloog_Matrix): Same.
+ (insert_constraint_into_matrix): Removed.
+
2010-07-04 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f10a9b0..16b8c7b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1239,6 +1239,7 @@ OBJS-common = \
graphite.o \
graphite-blocking.o \
graphite-clast-to-gimple.o \
+ graphite-cloog-util.o \
graphite-dependences.o \
graphite-interchange.o \
graphite-poly.o \
@@ -2678,9 +2679,11 @@ graphite-clast-to-gimple.o: graphite-clast-to-gimple.c $(CONFIG_H) \
$(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
$(TREE_DATA_REF_H) tree-pass.h domwalk.h graphite.h \
- pointer-set.h value-prof.h graphite-ppl.h sese.h \
+ pointer-set.h value-prof.h graphite-cloog-util.h graphite-ppl.h sese.h \
graphite-scop-detection.h graphite-clast-to-gimple.h graphite-poly.h \
graphite-dependences.h
+graphite-cloog-util.o: graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TMP_H) $(GGC_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) \
@@ -2700,7 +2703,7 @@ graphite-poly.o: graphite-poly.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
pointer-set.h value-prof.h graphite-ppl.h sese.h output.h graphite-poly.h \
tree-pretty-print.h gimple-pretty-print.h
graphite-ppl.o: graphite-ppl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(GGC_H) graphite-ppl.h
+ $(GGC_H) graphite-ppl.h graphite-cloog-util.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) $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) $(GIMPLE_H) \
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index aca2c31..f1d7475 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3. If not see
#ifdef HAVE_cloog
#include "cloog/cloog.h"
#include "ppl_c.h"
+#include "graphite-cloog-util.h"
#include "graphite-ppl.h"
#include "graphite.h"
#include "graphite-poly.h"
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
new file mode 100644
index 0000000..21a7872
--- /dev/null
+++ b/gcc/graphite-cloog-util.c
@@ -0,0 +1,275 @@
+/* Gimple Represented as Polyhedra.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Contributed by Sebastian Pop <sebastian.pop@inria.fr>
+ and Tobias Grosser <grosser@fim.uni-passau.de>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "ggc.h"
+
+#ifdef HAVE_cloog
+
+#include "ppl_c.h"
+#include "cloog/cloog.h"
+#include "graphite-cloog-util.h"
+
+/* Counts the number of constraints in PCS. */
+
+static int
+ppl_Constrain_System_number_of_constraints (ppl_const_Constraint_System_t pcs)
+{
+ ppl_Constraint_System_const_iterator_t cit, end;
+ int num = 0;
+
+ ppl_new_Constraint_System_const_iterator (&cit);
+ ppl_new_Constraint_System_const_iterator (&end);
+
+ for (ppl_Constraint_System_begin (pcs, cit),
+ ppl_Constraint_System_end (pcs, end);
+ !ppl_Constraint_System_const_iterator_equal_test (cit, end);
+ ppl_Constraint_System_const_iterator_increment (cit))
+ num++;
+
+ ppl_delete_Constraint_System_const_iterator (cit);
+ ppl_delete_Constraint_System_const_iterator (end);
+ return num;
+}
+
+static void
+oppose_constraint (CloogMatrix *m, int row)
+{
+ int k;
+
+ /* Do not oppose the first column: it is the eq/ineq one. */
+ for (k = 1; k < m->NbColumns; k++)
+ mpz_neg (m->p[row][k], m->p[row][k]);
+}
+
+/* Inserts constraint CSTR at row ROW of matrix M. */
+
+static void
+insert_constraint_into_matrix (CloogMatrix *m, int row,
+ ppl_const_Constraint_t cstr)
+{
+ ppl_Coefficient_t c;
+ ppl_dimension_type i, dim, nb_cols = m->NbColumns;
+
+ ppl_Constraint_space_dimension (cstr, &dim);
+ ppl_new_Coefficient (&c);
+
+ for (i = 0; i < dim; i++)
+ {
+ ppl_Constraint_coefficient (cstr, i, c);
+ ppl_Coefficient_to_mpz_t (c, m->p[row][i + 1]);
+ }
+
+ for (i = dim; i < nb_cols - 1; i++)
+ mpz_set_si (m->p[row][i + 1], 0);
+
+ ppl_Constraint_inhomogeneous_term (cstr, c);
+ ppl_Coefficient_to_mpz_t (c, m->p[row][nb_cols - 1]);
+ mpz_set_si (m->p[row][0], 1);
+
+ switch (ppl_Constraint_type (cstr))
+ {
+ case PPL_CONSTRAINT_TYPE_LESS_THAN:
+ oppose_constraint (m, row);
+ case PPL_CONSTRAINT_TYPE_GREATER_THAN:
+ mpz_sub_ui (m->p[row][nb_cols - 1],
+ m->p[row][nb_cols - 1], 1);
+ break;
+
+ case PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL:
+ oppose_constraint (m, row);
+ case PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL:
+ break;
+
+ case PPL_CONSTRAINT_TYPE_EQUAL:
+ mpz_set_si (m->p[row][0], 0);
+ break;
+
+ default:
+ /* Not yet implemented. */
+ gcc_unreachable();
+ }
+
+ ppl_delete_Coefficient (c);
+}
+
+/* Creates a CloogMatrix from constraint system PCS. */
+
+static CloogMatrix *
+new_Cloog_Matrix_from_ppl_Constraint_System (ppl_const_Constraint_System_t pcs)
+{
+ CloogMatrix *matrix;
+ ppl_Constraint_System_const_iterator_t cit, end;
+ ppl_dimension_type dim;
+ int rows;
+ int row = 0;
+
+ rows = ppl_Constrain_System_number_of_constraints (pcs);
+ ppl_Constraint_System_space_dimension (pcs, &dim);
+ matrix = cloog_matrix_alloc (rows, dim + 2);
+ ppl_new_Constraint_System_const_iterator (&cit);
+ ppl_new_Constraint_System_const_iterator (&end);
+
+ for (ppl_Constraint_System_begin (pcs, cit),
+ ppl_Constraint_System_end (pcs, end);
+ !ppl_Constraint_System_const_iterator_equal_test (cit, end);
+ ppl_Constraint_System_const_iterator_increment (cit))
+ {
+ ppl_const_Constraint_t c;
+ ppl_Constraint_System_const_iterator_dereference (cit, &c);
+ insert_constraint_into_matrix (matrix, row, c);
+ row++;
+ }
+
+ ppl_delete_Constraint_System_const_iterator (cit);
+ ppl_delete_Constraint_System_const_iterator (end);
+
+ return matrix;
+}
+
+/* Creates a CloogMatrix from polyhedron PH. */
+
+CloogMatrix *
+new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph)
+{
+ ppl_const_Constraint_System_t pcs;
+ CloogMatrix *res;
+
+ ppl_Polyhedron_get_constraints (ph, &pcs);
+ res = new_Cloog_Matrix_from_ppl_Constraint_System (pcs);
+
+ return res;
+}
+
+/* Translates row ROW of the CloogMatrix MATRIX to a PPL Constraint. */
+
+static ppl_Constraint_t
+cloog_matrix_to_ppl_constraint (CloogMatrix *matrix, int row)
+{
+ int j;
+ ppl_Constraint_t cstr;
+ ppl_Coefficient_t coef;
+ ppl_Linear_Expression_t expr;
+ ppl_dimension_type dim = matrix->NbColumns - 2;
+
+ ppl_new_Coefficient (&coef);
+ ppl_new_Linear_Expression_with_dimension (&expr, dim);
+
+ for (j = 1; j < matrix->NbColumns - 1; j++)
+ {
+ ppl_assign_Coefficient_from_mpz_t (coef, matrix->p[row][j]);
+ ppl_Linear_Expression_add_to_coefficient (expr, j - 1, coef);
+ }
+
+ ppl_assign_Coefficient_from_mpz_t (coef,
+ matrix->p[row][matrix->NbColumns - 1]);
+ ppl_Linear_Expression_add_to_inhomogeneous (expr, coef);
+ ppl_delete_Coefficient (coef);
+
+ if (mpz_sgn (matrix->p[row][0]))
+ ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_EQUAL);
+ else
+ ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
+
+ ppl_delete_Linear_Expression (expr);
+ return cstr;
+}
+
+/* Creates a PPL constraint system from MATRIX. */
+
+static void
+new_Constraint_System_from_Cloog_Matrix (ppl_Constraint_System_t *pcs,
+ CloogMatrix *matrix)
+{
+ int i;
+
+ ppl_new_Constraint_System (pcs);
+
+ for (i = 0; i < matrix->NbRows; i++)
+ {
+ ppl_Constraint_t c = cloog_matrix_to_ppl_constraint (matrix, i);
+ ppl_Constraint_System_insert_Constraint (*pcs, c);
+ ppl_delete_Constraint (c);
+ }
+}
+
+/* Creates a PPL Polyhedron from MATRIX. */
+
+void
+new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *ph,
+ CloogMatrix *matrix)
+{
+ ppl_Constraint_System_t cs;
+ new_Constraint_System_from_Cloog_Matrix (&cs, matrix);
+ ppl_new_C_Polyhedron_recycle_Constraint_System (ph, cs);
+}
+
+/* Creates a CloogDomain from polyhedron PH. */
+
+CloogDomain *
+new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph)
+{
+ CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph);
+ CloogDomain *res = cloog_domain_matrix2domain (mat);
+ cloog_matrix_free (mat);
+ return res;
+}
+
+/* Creates a CloogDomain from a pointset powerset PS. */
+
+CloogDomain *
+new_Cloog_Domain_from_ppl_Pointset_Powerset (
+ ppl_Pointset_Powerset_C_Polyhedron_t ps)
+{
+ CloogDomain *res = NULL;
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_t it, end;
+
+ ppl_new_Pointset_Powerset_C_Polyhedron_iterator (&it);
+ ppl_new_Pointset_Powerset_C_Polyhedron_iterator (&end);
+
+ for (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (ps, it),
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_end (ps, end);
+ !ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (it, end);
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (it))
+ {
+ ppl_const_Polyhedron_t ph;
+ CloogDomain *tmp;
+
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (it, &ph);
+ tmp = new_Cloog_Domain_from_ppl_Polyhedron (ph);
+
+ if (res == NULL)
+ res = tmp;
+ else
+ res = cloog_domain_union (res, tmp);
+ }
+
+ ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (it);
+ ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (end);
+
+ gcc_assert (res != NULL);
+
+ return res;
+}
+#endif
diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
new file mode 100644
index 0000000..17a3be4
--- /dev/null
+++ b/gcc/graphite-cloog-util.h
@@ -0,0 +1,30 @@
+/* Gimple Represented as Polyhedra.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Contributed by Sebastian Pop <sebastian.pop@inria.fr>
+ and Tobias Grosser <grosser@fim.uni-passau.de>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+#ifndef GRAPHITE_CLOOG_UTIL_H
+#define GRAPHITE_CLOOG_UTIL_H
+
+CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
+CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
+CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset (
+ ppl_Pointset_Powerset_C_Polyhedron_t);
+void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);
+
+#endif /* GRAPHITE_CLOOG_UTIL_H */
diff --git a/gcc/graphite-ppl.c b/gcc/graphite-ppl.c
index 9f5bab0..9dd98bb 100644
--- a/gcc/graphite-ppl.c
+++ b/gcc/graphite-ppl.c
@@ -29,250 +29,9 @@ along with GCC; see the file COPYING3. If not see
#include "ppl_c.h"
#include "cloog/cloog.h"
+#include "graphite-cloog-util.h"
#include "graphite-ppl.h"
-/* Translates row ROW of the CloogMatrix MATRIX to a PPL Constraint. */
-
-static ppl_Constraint_t
-cloog_matrix_to_ppl_constraint (CloogMatrix *matrix, int row)
-{
- int j;
- ppl_Constraint_t cstr;
- ppl_Coefficient_t coef;
- ppl_Linear_Expression_t expr;
- ppl_dimension_type dim = matrix->NbColumns - 2;
-
- ppl_new_Coefficient (&coef);
- ppl_new_Linear_Expression_with_dimension (&expr, dim);
-
- for (j = 1; j < matrix->NbColumns - 1; j++)
- {
- ppl_assign_Coefficient_from_mpz_t (coef, matrix->p[row][j]);
- ppl_Linear_Expression_add_to_coefficient (expr, j - 1, coef);
- }
-
- ppl_assign_Coefficient_from_mpz_t (coef,
- matrix->p[row][matrix->NbColumns - 1]);
- ppl_Linear_Expression_add_to_inhomogeneous (expr, coef);
- ppl_delete_Coefficient (coef);
-
- if (mpz_sgn (matrix->p[row][0]))
- ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_EQUAL);
- else
- ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
-
- ppl_delete_Linear_Expression (expr);
- return cstr;
-}
-
-/* Creates a PPL constraint system from MATRIX. */
-
-static void
-new_Constraint_System_from_Cloog_Matrix (ppl_Constraint_System_t *pcs,
- CloogMatrix *matrix)
-{
- int i;
-
- ppl_new_Constraint_System (pcs);
-
- for (i = 0; i < matrix->NbRows; i++)
- {
- ppl_Constraint_t c = cloog_matrix_to_ppl_constraint (matrix, i);
- ppl_Constraint_System_insert_Constraint (*pcs, c);
- ppl_delete_Constraint (c);
- }
-}
-
-/* Creates a PPL Polyhedron from MATRIX. */
-
-void
-new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *ph,
- CloogMatrix *matrix)
-{
- ppl_Constraint_System_t cs;
- new_Constraint_System_from_Cloog_Matrix (&cs, matrix);
- ppl_new_C_Polyhedron_recycle_Constraint_System (ph, cs);
-}
-
-/* Counts the number of constraints in PCS. */
-
-static int
-ppl_Constrain_System_number_of_constraints (ppl_const_Constraint_System_t pcs)
-{
- ppl_Constraint_System_const_iterator_t cit, end;
- int num = 0;
-
- ppl_new_Constraint_System_const_iterator (&cit);
- ppl_new_Constraint_System_const_iterator (&end);
-
- for (ppl_Constraint_System_begin (pcs, cit),
- ppl_Constraint_System_end (pcs, end);
- !ppl_Constraint_System_const_iterator_equal_test (cit, end);
- ppl_Constraint_System_const_iterator_increment (cit))
- num++;
-
- ppl_delete_Constraint_System_const_iterator (cit);
- ppl_delete_Constraint_System_const_iterator (end);
- return num;
-}
-
-static void
-oppose_constraint (CloogMatrix *m, int row)
-{
- int k;
-
- /* Do not oppose the first column: it is the eq/ineq one. */
- for (k = 1; k < m->NbColumns; k++)
- mpz_neg (m->p[row][k], m->p[row][k]);
-}
-
-/* Inserts constraint CSTR at row ROW of matrix M. */
-
-void
-insert_constraint_into_matrix (CloogMatrix *m, int row,
- ppl_const_Constraint_t cstr)
-{
- ppl_Coefficient_t c;
- ppl_dimension_type i, dim, nb_cols = m->NbColumns;
-
- ppl_Constraint_space_dimension (cstr, &dim);
- ppl_new_Coefficient (&c);
-
- for (i = 0; i < dim; i++)
- {
- ppl_Constraint_coefficient (cstr, i, c);
- ppl_Coefficient_to_mpz_t (c, m->p[row][i + 1]);
- }
-
- for (i = dim; i < nb_cols - 1; i++)
- mpz_set_si (m->p[row][i + 1], 0);
-
- ppl_Constraint_inhomogeneous_term (cstr, c);
- ppl_Coefficient_to_mpz_t (c, m->p[row][nb_cols - 1]);
- mpz_set_si (m->p[row][0], 1);
-
- switch (ppl_Constraint_type (cstr))
- {
- case PPL_CONSTRAINT_TYPE_LESS_THAN:
- oppose_constraint (m, row);
- case PPL_CONSTRAINT_TYPE_GREATER_THAN:
- mpz_sub_ui (m->p[row][nb_cols - 1],
- m->p[row][nb_cols - 1], 1);
- break;
-
- case PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL:
- oppose_constraint (m, row);
- case PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL:
- break;
-
- case PPL_CONSTRAINT_TYPE_EQUAL:
- mpz_set_si (m->p[row][0], 0);
- break;
-
- default:
- /* Not yet implemented. */
- gcc_unreachable();
- }
-
- ppl_delete_Coefficient (c);
-}
-
-/* Creates a CloogMatrix from constraint system PCS. */
-
-static CloogMatrix *
-new_Cloog_Matrix_from_ppl_Constraint_System (ppl_const_Constraint_System_t pcs)
-{
- CloogMatrix *matrix;
- ppl_Constraint_System_const_iterator_t cit, end;
- ppl_dimension_type dim;
- int rows;
- int row = 0;
-
- rows = ppl_Constrain_System_number_of_constraints (pcs);
- ppl_Constraint_System_space_dimension (pcs, &dim);
- matrix = cloog_matrix_alloc (rows, dim + 2);
- ppl_new_Constraint_System_const_iterator (&cit);
- ppl_new_Constraint_System_const_iterator (&end);
-
- for (ppl_Constraint_System_begin (pcs, cit),
- ppl_Constraint_System_end (pcs, end);
- !ppl_Constraint_System_const_iterator_equal_test (cit, end);
- ppl_Constraint_System_const_iterator_increment (cit))
- {
- ppl_const_Constraint_t c;
- ppl_Constraint_System_const_iterator_dereference (cit, &c);
- insert_constraint_into_matrix (matrix, row, c);
- row++;
- }
-
- ppl_delete_Constraint_System_const_iterator (cit);
- ppl_delete_Constraint_System_const_iterator (end);
-
- return matrix;
-}
-
-/* Creates a CloogMatrix from polyhedron PH. */
-
-CloogMatrix *
-new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph)
-{
- ppl_const_Constraint_System_t pcs;
- CloogMatrix *res;
-
- ppl_Polyhedron_get_constraints (ph, &pcs);
- res = new_Cloog_Matrix_from_ppl_Constraint_System (pcs);
-
- return res;
-}
-
-/* Creates a CloogDomain from polyhedron PH. */
-
-CloogDomain *
-new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph)
-{
- CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph);
- CloogDomain *res = cloog_domain_matrix2domain (mat);
- cloog_matrix_free (mat);
- return res;
-}
-
-/* Creates a CloogDomain from a pointset powerset PS. */
-
-CloogDomain *
-new_Cloog_Domain_from_ppl_Pointset_Powerset (
- ppl_Pointset_Powerset_C_Polyhedron_t ps)
-{
- CloogDomain *res = NULL;
- ppl_Pointset_Powerset_C_Polyhedron_iterator_t it, end;
-
- ppl_new_Pointset_Powerset_C_Polyhedron_iterator (&it);
- ppl_new_Pointset_Powerset_C_Polyhedron_iterator (&end);
-
- for (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (ps, it),
- ppl_Pointset_Powerset_C_Polyhedron_iterator_end (ps, end);
- !ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (it, end);
- ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (it))
- {
- ppl_const_Polyhedron_t ph;
- CloogDomain *tmp;
-
- ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (it, &ph);
- tmp = new_Cloog_Domain_from_ppl_Polyhedron (ph);
-
- if (res == NULL)
- res = tmp;
- else
- res = cloog_domain_union (res, tmp);
- }
-
- ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (it);
- ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (end);
-
- gcc_assert (res != NULL);
-
- return res;
-}
-
/* Set the inhomogeneous term of E to X. */
void
diff --git a/gcc/graphite-ppl.h b/gcc/graphite-ppl.h
index 6d5e09d..ec5d3c5 100644
--- a/gcc/graphite-ppl.h
+++ b/gcc/graphite-ppl.h
@@ -24,12 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "double-int.h"
#include "tree.h"
-CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
-CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
-CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset (
- ppl_Pointset_Powerset_C_Polyhedron_t);
-void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);
-void insert_constraint_into_matrix (CloogMatrix *, int, ppl_const_Constraint_t);
ppl_Polyhedron_t ppl_strip_loop (ppl_Polyhedron_t, ppl_dimension_type, int);
int ppl_lexico_compare_linear_expressions (ppl_Linear_Expression_t,
ppl_Linear_Expression_t);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 11/65] Launch dotty in background.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (26 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 37/65] Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 31/65] Partially removing cloog.h and graphite-clast-to-gimple.h where possible. Removing unused function check_poly_representation Sebastian Pop
` (39 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
* graphite-dependences.c (dot_deps): Make system call to dotty run
in background.
(dot_deps_stmt): Same.
* graphite-poly.c (dot_lst): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@160650 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 7 +++++++
gcc/ChangeLog.graphite | 7 +++++++
gcc/graphite-dependences.c | 4 ++--
gcc/graphite-poly.c | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 63e75ab..0d68719 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-dependences.c (dot_deps): Make system call to dotty run
+ in background.
+ (dot_deps_stmt): Same.
+ * graphite-poly.c (dot_lst): Same.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
phi_arg_in_outermost_loop.
(remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 4b802ee..2e04618 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,10 @@
+2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (dot_deps): Make system call to dotty run
+ in background.
+ (dot_deps_stmt): Same.
+ * graphite-poly.c (dot_lst): Same.
+
2010-06-11 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (gcc_type_for_interval): Do not pass
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index f060ea0..af4c962 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -964,7 +964,7 @@ dot_deps (scop_p scop)
dot_deps_1 (stream, scop);
fclose (stream);
- x = system ("dotty /tmp/scopdeps.dot");
+ x = system ("dotty /tmp/scopdeps.dot &");
#else
dot_deps_1 (stderr, scop);
#endif
@@ -985,7 +985,7 @@ dot_deps_stmt (scop_p scop)
dot_deps_stmt_1 (stream, scop);
fclose (stream);
- x = system ("dotty /tmp/scopdeps.dot");
+ x = system ("dotty /tmp/scopdeps.dot &");
#else
dot_deps_stmt_1 (stderr, scop);
#endif
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 7eb45ca..28da7f0 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -1285,7 +1285,7 @@ dot_lst (lst_p lst)
fputs ("}\n\n", stream);
fclose (stream);
- x = system ("dotty /tmp/lst.dot");
+ x = system ("dotty /tmp/lst.dot &");
#else
fputs ("digraph all {\n", stderr);
dot_lst_1 (stderr, lst);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 23/65] Remove copy_renames.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (18 preceding siblings ...)
2010-08-02 20:22 ` [PATCH 16/65] Schedule a copy_prop pass before graphite Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 27/65] Fix 416.gamess miscompile: special case the rewrite of degenerate phi nodes Sebastian Pop
` (47 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (copy_renames): Removed.
(translate_clast_for): Do not call copy_renames.
(translate_clast_guard): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161356 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 6 ++++
gcc/ChangeLog.graphite | 6 ++++
gcc/graphite-clast-to-gimple.c | 63 ++++-----------------------------------
3 files changed, 19 insertions(+), 56 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f12de88..82b49e4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (copy_renames): Removed.
+ (translate_clast_for): Do not call copy_renames.
+ (translate_clast_guard): Same.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Moved up.
(rewrite_cross_bb_phi_deps): Split out of rewrite_cross_bb_scalar_deps.
(rewrite_cross_bb_scalar_deps_out_of_ssa): Run rewrite_cross_bb_phi_deps
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index d736895..40777c0 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,9 @@
+2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (copy_renames): Removed.
+ (translate_clast_for): Do not call copy_renames.
+ (translate_clast_guard): Same.
+
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Moved up.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 8b972b8..a610bc5 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -846,27 +846,6 @@ build_iv_mapping (htab_t map, sese region,
}
}
-/* Helper function for htab_traverse. */
-
-static int
-copy_renames (void **slot, void *s)
-{
- struct rename_map_elt_s *entry = (struct rename_map_elt_s *) *slot;
- htab_t res = (htab_t) s;
- tree old_name = entry->old_name;
- tree expr = entry->expr;
- struct rename_map_elt_s tmp;
- PTR *x;
-
- tmp.old_name = old_name;
- x = htab_find_slot (res, &tmp, INSERT);
-
- if (x && !*x)
- *x = new_rename_map_elt (old_name, expr);
-
- return 1;
-}
-
/* Construct bb_pbb_def with BB and PBB. */
static bb_pbb_def *
@@ -1095,26 +1074,12 @@ translate_clast_for (sese region, loop_p context_loop, struct clast_for *stmt,
{
edge last_e = graphite_create_new_loop_guard (region, next_e, stmt, *newivs,
newivs_index, params_index);
-
edge true_e = get_true_edge_from_guard_bb (next_e->dest);
- edge false_e = get_false_edge_from_guard_bb (next_e->dest);
- edge exit_true_e = single_succ_edge (true_e->dest);
- edge exit_false_e = single_succ_edge (false_e->dest);
-
- htab_t before_guard = htab_create (10, rename_map_elt_info,
- eq_rename_map_elts, free);
- htab_traverse (rename_map, copy_renames, before_guard);
-
- next_e = translate_clast_for_loop (region, context_loop, stmt, true_e,
- rename_map, newivs,
- newivs_index, bb_pbb_mapping, level,
- params_index);
-
- insert_guard_phis (last_e->src, exit_true_e, exit_false_e,
- before_guard, rename_map);
-
- htab_delete (before_guard);
+ translate_clast_for_loop (region, context_loop, stmt, true_e,
+ rename_map, newivs,
+ newivs_index, bb_pbb_mapping, level,
+ params_index);
return last_e;
}
@@ -1137,25 +1102,11 @@ translate_clast_guard (sese region, loop_p context_loop,
{
edge last_e = graphite_create_new_guard (region, next_e, stmt, *newivs,
newivs_index, params_index);
-
edge true_e = get_true_edge_from_guard_bb (next_e->dest);
- edge false_e = get_false_edge_from_guard_bb (next_e->dest);
- edge exit_true_e = single_succ_edge (true_e->dest);
- edge exit_false_e = single_succ_edge (false_e->dest);
-
- htab_t before_guard = htab_create (10, rename_map_elt_info,
- eq_rename_map_elts, free);
- htab_traverse (rename_map, copy_renames, before_guard);
-
- next_e = translate_clast (region, context_loop, stmt->then, true_e,
- rename_map, newivs, newivs_index, bb_pbb_mapping,
- level, params_index);
-
- insert_guard_phis (last_e->src, exit_true_e, exit_false_e,
- before_guard, rename_map);
-
- htab_delete (before_guard);
+ translate_clast (region, context_loop, stmt->then, true_e,
+ rename_map, newivs, newivs_index, bb_pbb_mapping,
+ level, params_index);
return last_e;
}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 37/65] Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (25 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 38/65] Remove uses of loop->single_iv Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 11/65] Launch dotty in background Sebastian Pop
` (40 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also
handle GIMPLE_CALL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162245 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 5 +++++
gcc/graphite-sese-to-poly.c | 16 +++++++++++++---
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 46b7c59..1272bdb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also
+ handle GIMPLE_CALL.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* tree-chrec.c (chrec_apply): Should only apply to the specified
variable. Also handle multivariate chains of recurrences that
satisfy evolution_function_is_affine_p. Also handle CASE_CONVERT.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c46bd70..e26a1b3 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also
+ handle GIMPLE_CALL.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* tree-chrec.c (chrec_apply): Should only apply to the specified
variable. Also handle multivariate chains of recurrences that
satisfy evolution_function_is_affine_p. Also handle CASE_CONVERT.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index b9bf284..7c47a80 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2405,10 +2405,20 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
tree zero_dim_array = NULL_TREE;
gimple use_stmt;
- if (gimple_code (stmt) != GIMPLE_ASSIGN)
- return;
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_ASSIGN:
+ def = gimple_assign_lhs (stmt);
+ break;
+
+ case GIMPLE_CALL:
+ def = gimple_call_lhs (stmt);
+ break;
+
+ default:
+ return;
+ }
- def = gimple_assign_lhs (stmt);
if (!is_gimple_reg (def)
|| scev_analyzable_p (def, region))
return;
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 27/65] Fix 416.gamess miscompile: special case the rewrite of degenerate phi nodes.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (19 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 23/65] Remove copy_renames Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 33/65] Fix flipped condition using mpz_sgn Sebastian Pop
` (46 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_degenerate_phi): New.
(rewrite_reductions_out_of_ssa): Call it for degenerate_phi_result.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161360 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 5 +++++
gcc/graphite-sese-to-poly.c | 40 +++++++++++++++++++++++++++++++++++++++-
3 files changed, 49 insertions(+), 1 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2013c55..397839b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_degenerate_phi): New.
+ (rewrite_reductions_out_of_ssa): Call it for degenerate_phi_result.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
rewrite_close_phi_out_of_ssa.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index ee63b7c..a488c39 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_degenerate_phi): New.
+ (rewrite_reductions_out_of_ssa): Call it for degenerate_phi_result.
+
+2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
rewrite_close_phi_out_of_ssa.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 8857946..62064c4 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2272,6 +2272,37 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi)
gsi_insert_seq_before (&gsi, stmts, GSI_NEW_STMT);
}
+/* Rewrite the degenerate phi node at position PSI from the degenerate
+ form "x = phi (y, y, ..., y)" to "x = y". */
+
+static void
+rewrite_degenerate_phi (gimple_stmt_iterator *psi)
+{
+ tree rhs;
+ gimple stmt;
+ gimple_stmt_iterator gsi;
+ gimple phi = gsi_stmt (*psi);
+ tree res = gimple_phi_result (phi);
+ basic_block bb;
+
+ if (!is_gimple_reg (res))
+ {
+ gsi_next (psi);
+ return;
+ }
+
+ bb = gimple_bb (phi);
+ rhs = degenerate_phi_result (phi);
+ gcc_assert (rhs);
+
+ stmt = gimple_build_assign (res, rhs);
+ remove_phi_node (psi, false);
+ SSA_NAME_DEF_STMT (res) = stmt;
+
+ gsi = gsi_after_labels (bb);
+ gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
+}
+
/* Rewrite out of SSA all the reduction phi nodes of SCOP. */
void
@@ -2285,8 +2316,15 @@ rewrite_reductions_out_of_ssa (scop_p scop)
if (bb_in_sese_p (bb, region))
for (psi = gsi_start_phis (bb); !gsi_end_p (psi);)
{
- if (scalar_close_phi_node_p (gsi_stmt (psi)))
+ gimple phi = gsi_stmt (psi);
+
+ if (gimple_phi_num_args (phi) > 1
+ && degenerate_phi_result (phi))
+ rewrite_degenerate_phi (&psi);
+
+ else if (scalar_close_phi_node_p (phi))
rewrite_close_phi_out_of_ssa (&psi);
+
else if (reduction_phi_p (region, &psi))
rewrite_phi_out_of_ssa (&psi);
}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 28/65] Print bbs in refined region tree.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (28 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 31/65] Partially removing cloog.h and graphite-clast-to-gimple.h where possible. Removing unused function check_poly_representation Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 30/65] Move cloog-related functions from graphite-ppl.{c,h} to new graphite-cloog-util.{c,h} Sebastian Pop
` (37 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-25 Vladimir Kargov <kargov@gmail.com>
* refined-regions.c (bb_index_compare): New.
(get_bbs_in_region): New.
(print_bbs_in_region): New.
(print_refined_region): Add an argument that allows to print
all basic blocks contained in regions.
(debug_refined_region): Update call to print_refined_region.
* refined-regions.h (print_refined_region): Update declaration.
(get_bbs_in_region): Declared.
* graphite-scop-detection.c (build_scops_new): Print the refined
region tree into the Grahite dump file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161418 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index a488c39..34a83b6 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,16 @@
+2010-06-25 Vladimir Kargov <kargov@gmail.com>
+
+ * refined-regions.c (bb_index_compare): New.
+ (get_bbs_in_region): New.
+ (print_bbs_in_region): New.
+ (print_refined_region): Add an argument that allows to print
+ all basic blocks contained in regions.
+ (debug_refined_region): Update call to print_refined_region.
+ * refined-regions.h (print_refined_region): Update declaration.
+ (get_bbs_in_region): Declared.
+ * graphite-scop-detection.c (build_scops_new): Print the refined
+ region tree into the Grahite dump file.
+
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_degenerate_phi): New.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 40/65] Scevs could be expressions without chrecs and still be scev_analyzable_p.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (32 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 26/65] Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from rewrite_cross_bb_phi_deps Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 36/65] chrec_apply should only apply to the specified variable Sebastian Pop
` (33 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* sese.h (scev_analyzable_p): Scevs could be expressions without
chrecs and still be scev_analyzable_p.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162248 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 5 +++++
gcc/sese.h | 3 ++-
3 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6c67ad..524376d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * sese.h (scev_analyzable_p): Scevs could be expressions without
+ chrecs and still be scev_analyzable_p.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 9eb3ae8..a93e035 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * sese.h (scev_analyzable_p): Scevs could be expressions without
+ chrecs and still be scev_analyzable_p.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/sese.h b/gcc/sese.h
index 1502cbe..f10030c 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -398,7 +398,8 @@ scev_analyzable_p (tree def, sese region)
return !chrec_contains_undetermined (scev)
&& TREE_CODE (scev) != SSA_NAME
- && evolution_function_is_affine_p (scev);
+ && (tree_does_not_contain_chrecs (scev)
+ || evolution_function_is_affine_p (scev));
}
#endif
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 38/65] Remove uses of loop->single_iv.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (24 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 32/65] Add testcase for miscompile in gamess Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 37/65] Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps Sebastian Pop
` (41 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
* cfgloop.h (struct loop): Remove single_iv field.
* graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
(scop_canonicalize_loops): Removed.
(scop_ivs_can_be_represented): Do not use loop->single_iv. Iterate
over all the loop phi nodes in loop->header.
(build_poly_scop): Remove use of scop_canonicalize_loops.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162246 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 10 +++++++
gcc/ChangeLog.graphite | 10 +++++++
gcc/cfgloop.c | 1 -
gcc/cfgloop.h | 4 ---
gcc/graphite-sese-to-poly.c | 62 +++++++-----------------------------------
5 files changed, 31 insertions(+), 56 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1272bdb..69a2dc1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
+ * cfgloop.h (struct loop): Remove single_iv field.
+ * graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
+ (scop_canonicalize_loops): Removed.
+ (scop_ivs_can_be_represented): Do not use loop->single_iv. Iterate
+ over all the loop phi nodes in loop->header.
+ (build_poly_scop): Remove use of scop_canonicalize_loops.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also
handle GIMPLE_CALL.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index e26a1b3..07b48a3 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,15 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
+ * cfgloop.h (struct loop): Remove single_iv field.
+ * graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
+ (scop_canonicalize_loops): Removed.
+ (scop_ivs_can_be_represented): Do not use loop->single_iv. Iterate
+ over all the loop phi nodes in loop->header.
+ (build_poly_scop): Remove use of scop_canonicalize_loops.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Also
handle GIMPLE_CALL.
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 370c68d..24f0ebc 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -339,7 +339,6 @@ alloc_loop (void)
loop->exits = ggc_alloc_cleared_loop_exit ();
loop->exits->next = loop->exits->prev = loop->exits;
loop->can_be_parallel = false;
- loop->single_iv = NULL_TREE;
return loop;
}
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 535e256..1f0e3ca 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -165,10 +165,6 @@ struct GTY ((chain_next ("%h.next"))) loop {
/* Head of the cyclic list of the exits of the loop. */
struct loop_exit *exits;
-
- /* The single induction variable of the loop when the loop is in
- normal form. */
- tree single_iv;
};
/* Flags for state of loop structure. */
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 7c47a80..5a8db3d 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2906,45 +2906,6 @@ rewrite_commutative_reductions_out_of_ssa (sese region, sbitmap reductions)
#endif
}
-/* A LOOP is in normal form for Graphite when it contains only one
- scalar phi node that defines the main induction variable of the
- loop, only one increment of the IV, and only one exit condition. */
-
-static void
-graphite_loop_normal_form (loop_p loop)
-{
- struct tree_niter_desc niter;
- tree nit;
- gimple_seq stmts;
- edge exit = single_dom_exit (loop);
-
- bool known_niter = number_of_iterations_exit (loop, exit, &niter, false);
-
- /* At this point we should know the number of iterations. */
- gcc_assert (known_niter);
-
- nit = force_gimple_operand (unshare_expr (niter.niter), &stmts, true,
- NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
-
- loop->single_iv = canonicalize_loop_ivs (loop, &nit, false);
-}
-
-/* Rewrite all the loops of SCOP in normal form: one induction
- variable per loop. */
-
-static void
-scop_canonicalize_loops (scop_p scop)
-{
- loop_iterator li;
- loop_p loop;
-
- FOR_EACH_LOOP (li, loop, 0)
- if (loop_in_sese_p (loop, SCOP_REGION (scop)))
- graphite_loop_normal_form (loop);
-}
-
/* Java does not initialize long_long_integer_type_node. */
#define my_long_long (long_long_integer_type_node ? long_long_integer_type_node : ssizetype)
@@ -2957,24 +2918,24 @@ scop_ivs_can_be_represented (scop_p scop)
{
loop_iterator li;
loop_p loop;
+ gimple_stmt_iterator psi;
FOR_EACH_LOOP (li, loop, 0)
{
- tree type;
- int precision;
-
if (!loop_in_sese_p (loop, SCOP_REGION (scop)))
continue;
- if (!loop->single_iv)
- continue;
-
- type = TREE_TYPE (loop->single_iv);
- precision = TYPE_PRECISION (type);
+ for (psi = gsi_start_phis (loop->header);
+ !gsi_end_p (psi); gsi_next (&psi))
+ {
+ gimple phi = gsi_stmt (psi);
+ tree res = PHI_RESULT (phi);
+ tree type = TREE_TYPE (res);
- if (TYPE_UNSIGNED (type)
- && precision >= TYPE_PRECISION (my_long_long))
- return false;
+ if (TYPE_UNSIGNED (type)
+ && TYPE_PRECISION (type) >= TYPE_PRECISION (my_long_long))
+ return false;
+ }
}
return true;
@@ -2998,7 +2959,6 @@ build_poly_scop (scop_p scop)
if (nb_pbbs_in_loops (scop) == 0)
return;
- scop_canonicalize_loops (scop);
if (!scop_ivs_can_be_represented (scop))
return;
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 20/65] Fix testcase: call abort.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (21 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 33/65] Fix flipped condition using mpz_sgn Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 25/65] Remove dead code Sebastian Pop
` (44 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
* gcc.dg/graphite/run-id-2.c: Call abort.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161293 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 4 ++++
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gcc.dg/graphite/run-id-2.c | 12 ++++++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 47cf924..abeda2a 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,9 @@
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/run-id-2.c: Call abort.
+
+2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Always insert out
of SSA copies on edges except for loop->latch.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d4d8d90..90c2798 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/run-id-2.c: Call abort.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/id-20.c: New.
2010-08-02 Bernd Schmidt <bernds@codesourcery.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/run-id-2.c b/gcc/testsuite/gcc.dg/graphite/run-id-2.c
index 0fd5efd..4a23616 100644
--- a/gcc/testsuite/gcc.dg/graphite/run-id-2.c
+++ b/gcc/testsuite/gcc.dg/graphite/run-id-2.c
@@ -19,9 +19,17 @@ static int __attribute__((noinline)) bar(int n)
return c;
}
+extern void abort ();
+
int main()
{
- return
- foo(0) != 0 || foo(1) != 1 || bar(0) != 0 || bar(1) != 2 || bar(2) != 5;
+ if (foo(0) != 0
+ || foo(1) != 1
+ || bar(0) != 0
+ || bar(1) != 2
+ || bar(2) != 5)
+ abort ();
+
+ return 0;
}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 32/65] Add testcase for miscompile in gamess.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (23 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 25/65] Remove dead code Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 38/65] Remove uses of loop->single_iv Sebastian Pop
` (42 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-07 Sebastian Pop <sebastian.pop@amd.com>
* gfortran.dg/graphite/id-20.f: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161915 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 4 ++++
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gfortran.dg/graphite/id-20.f | 4 ++++
3 files changed, 12 insertions(+), 0 deletions(-)
create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-20.f
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 5ef7688..fa59c75 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,7 @@
+2010-07-07 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gfortran.dg/graphite/id-20.f: New.
+
2010-07-05 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-cloog-util.h: Added cloog.h.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2463668..172aaa3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gfortran.dg/graphite/id-20.f: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/id-22.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-20.f b/gcc/testsuite/gfortran.dg/graphite/id-20.f
new file mode 100644
index 0000000..110ae3f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-20.f
@@ -0,0 +1,4 @@
+ DO 32 MB=1,NVIRA
+ * PVIRA(MA,MB)*(EA(MA+NOA)+EA(MB+NOA))*PT5
+ 32 CONTINUE
+ END
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 33/65] Fix flipped condition using mpz_sgn.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (20 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 27/65] Fix 416.gamess miscompile: special case the rewrite of degenerate phi nodes Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 20/65] Fix testcase: call abort Sebastian Pop
` (45 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-cloog-util.c
(cloog_matrix_to_ppl_constraint): Fix flipped condition.
* graphite-poly.c
(psct_scattering_dim_for_loop_depth): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162207 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 7 +++++++
gcc/ChangeLog.graphite | 7 +++++++
gcc/graphite-cloog-util.c | 2 +-
gcc/graphite-poly.c | 2 +-
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b0f30f1..c93abbf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-cloog-util.c
+ (cloog_matrix_to_ppl_constraint): Fix flipped condition.
+ * graphite-poly.c
+ (psct_scattering_dim_for_loop_depth): Same.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-cloog-util.h: Added cloog.h.
* graphite-blocking.c: Removed cloog.h.
* graphite-dependences.c: Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index fa59c75..806d67e 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,10 @@
+2010-07-15 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * graphite-cloog-util.c
+ (cloog_matrix_to_ppl_constraint): Fix flipped condition.
+ * graphite-poly.c
+ (psct_scattering_dim_for_loop_depth): Same.
+
2010-07-07 Sebastian Pop <sebastian.pop@amd.com>
* gfortran.dg/graphite/id-20.f: New.
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
index 21a7872..33ee5cf 100644
--- a/gcc/graphite-cloog-util.c
+++ b/gcc/graphite-cloog-util.c
@@ -187,7 +187,7 @@ cloog_matrix_to_ppl_constraint (CloogMatrix *matrix, int row)
ppl_Linear_Expression_add_to_inhomogeneous (expr, coef);
ppl_delete_Coefficient (coef);
- if (mpz_sgn (matrix->p[row][0]))
+ if (mpz_sgn (matrix->p[row][0]) == 0)
ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_EQUAL);
else
ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 67b9384..7d33aa8 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -1018,7 +1018,7 @@ psct_scattering_dim_for_loop_depth (poly_bb_p pbb, graphite_dim_t loop_depth)
ppl_Linear_Expression_coefficient (expr, iter, coef);
ppl_Coefficient_to_mpz_t (coef, val);
- if (mpz_sgn (val))
+ if (mpz_sgn (val) == 0)
{
ppl_delete_Linear_Expression (expr);
continue;
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 26/65] Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from rewrite_cross_bb_phi_deps.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (31 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 24/65] Replace map with rename_map Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 40/65] Scevs could be expressions without chrecs and still be scev_analyzable_p Sebastian Pop
` (34 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
rewrite_close_phi_out_of_ssa.
* gcc.dg/graphite/id-22.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161359 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 7 +++++++
gcc/graphite-sese-to-poly.c | 8 ++++++--
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gcc.dg/graphite/id-22.c | 15 +++++++++++++++
5 files changed, 37 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-22.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 95b5413..2013c55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
+ rewrite_close_phi_out_of_ssa.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c2be7c7..ee63b7c 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Call
+ rewrite_close_phi_out_of_ssa.
+
+ * gcc.dg/graphite/id-22.c: New.
+
+2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_cross_bb_phi_deps): Remove dead code.
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 318401e..8857946 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2361,8 +2361,12 @@ rewrite_cross_bb_phi_deps (sese region, gimple_stmt_iterator gsi)
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
if (gimple_code (use_stmt) == GIMPLE_PHI)
{
- gimple_stmt_iterator si = gsi_for_stmt (use_stmt);
- rewrite_phi_out_of_ssa (&si);
+ gimple_stmt_iterator psi = gsi_for_stmt (use_stmt);
+
+ if (scalar_close_phi_node_p (gsi_stmt (psi)))
+ rewrite_close_phi_out_of_ssa (&psi);
+ else
+ rewrite_phi_out_of_ssa (&psi);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 90c2798..2463668 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/id-22.c: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/run-id-2.c: Call abort.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/id-22.c b/gcc/testsuite/gcc.dg/graphite/id-22.c
new file mode 100644
index 0000000..d825542
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-22.c
@@ -0,0 +1,15 @@
+typedef float rvec[3];
+float calc_similar_ind (int nind, rvec x[])
+{
+ int i, j, d;
+ float m, tm, xd, rd;
+ for(j=0; j<nind; j++) {
+ i = x[j][0];
+ tm += m;
+ for(d=0 ; d<3; d++) {
+ xd = x[i][d] - x[i][d];
+ rd += m * xd;
+ }
+ }
+ return rd/tm;
+}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 24/65] Replace map with rename_map.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (30 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 30/65] Move cloog-related functions from graphite-ppl.{c,h} to new graphite-cloog-util.{c,h} Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 26/65] Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from rewrite_cross_bb_phi_deps Sebastian Pop
` (35 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (build_iv_mapping): Rename map with
rename_map.
* sese.c (debug_rename_map): Same.
(get_rename): Same.
(set_rename): Same.
(rename_variables_in_stmt): Same.
(expand_scalar_variables_call): Same.
(expand_scalar_variables_ssa_name): Same.
(expand_scalar_variables_expr): Same.
(expand_scalar_variables_stmt): Same.
(expand_scalar_variables): Same.
(rename_variables): Same.
(graphite_copy_stmts_from_block): Same.
(copy_bb_and_scalar_dependences): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161357 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 17 +++++++
gcc/ChangeLog.graphite | 17 +++++++
gcc/graphite-clast-to-gimple.c | 6 +-
gcc/sese.c | 96 ++++++++++++++++++++--------------------
4 files changed, 85 insertions(+), 51 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 82b49e4..183050a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,22 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (build_iv_mapping): Rename map with
+ rename_map.
+ * sese.c (debug_rename_map): Same.
+ (get_rename): Same.
+ (set_rename): Same.
+ (rename_variables_in_stmt): Same.
+ (expand_scalar_variables_call): Same.
+ (expand_scalar_variables_ssa_name): Same.
+ (expand_scalar_variables_expr): Same.
+ (expand_scalar_variables_stmt): Same.
+ (expand_scalar_variables): Same.
+ (rename_variables): Same.
+ (graphite_copy_stmts_from_block): Same.
+ (copy_bb_and_scalar_dependences): Same.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (copy_renames): Removed.
(translate_clast_for): Do not call copy_renames.
(translate_clast_guard): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 40777c0..3b04837 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,22 @@
2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (build_iv_mapping): Rename map with
+ rename_map.
+ * sese.c (debug_rename_map): Same.
+ (get_rename): Same.
+ (set_rename): Same.
+ (rename_variables_in_stmt): Same.
+ (expand_scalar_variables_call): Same.
+ (expand_scalar_variables_ssa_name): Same.
+ (expand_scalar_variables_expr): Same.
+ (expand_scalar_variables_stmt): Same.
+ (expand_scalar_variables): Same.
+ (rename_variables): Same.
+ (graphite_copy_stmts_from_block): Same.
+ (copy_bb_and_scalar_dependences): Same.
+
+2010-06-24 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (copy_renames): Removed.
(translate_clast_for): Do not call copy_renames.
(translate_clast_guard): Same.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index a610bc5..7eb9165 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -819,11 +819,11 @@ graphite_create_new_loop (sese region, edge entry_edge,
return loop;
}
-/* Inserts in MAP a tuple (OLD_NAME, NEW_NAME) for the induction
+/* Inserts in RENAME_MAP a tuple (OLD_NAME, NEW_NAME) for the induction
variables of the loops around GBB in SESE. */
static void
-build_iv_mapping (htab_t map, sese region,
+build_iv_mapping (htab_t rename_map, sese region,
VEC (tree, heap) *newivs, htab_t newivs_index,
struct clast_user_stmt *user_stmt,
htab_t params_index)
@@ -842,7 +842,7 @@ build_iv_mapping (htab_t map, sese region,
tree old_name = pbb_to_depth_to_oldiv (pbb, index);
tree e = clast_to_gcc_expression (type, expr, region, newivs,
newivs_index, params_index);
- set_rename (map, old_name, e);
+ set_rename (rename_map, old_name, e);
}
}
diff --git a/gcc/sese.c b/gcc/sese.c
index 8f6b7d7..a68ede5 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -67,12 +67,12 @@ debug_rename_map_1 (void **slot, void *s ATTRIBUTE_UNUSED)
return 1;
}
-/* Print to stderr all the elements of MAP. */
+/* Print to stderr all the elements of RENAME_MAP. */
DEBUG_FUNCTION void
-debug_rename_map (htab_t map)
+debug_rename_map (htab_t rename_map)
{
- htab_traverse (map, debug_rename_map_1, NULL);
+ htab_traverse (rename_map, debug_rename_map_1, NULL);
}
/* Computes a hash function for database element ELT. */
@@ -394,17 +394,17 @@ sese_insert_phis_for_liveouts (sese region, basic_block bb,
update_ssa (TODO_update_ssa);
}
-/* Returns the expression associated to OLD_NAME in MAP. */
+/* Returns the expression associated to OLD_NAME in RENAME_MAP. */
static tree
-get_rename (htab_t map, tree old_name)
+get_rename (htab_t rename_map, tree old_name)
{
struct rename_map_elt_s tmp;
PTR *slot;
gcc_assert (TREE_CODE (old_name) == SSA_NAME);
tmp.old_name = old_name;
- slot = htab_find_slot (map, &tmp, NO_INSERT);
+ slot = htab_find_slot (rename_map, &tmp, NO_INSERT);
if (slot && *slot)
return ((rename_map_elt) *slot)->expr;
@@ -412,10 +412,10 @@ get_rename (htab_t map, tree old_name)
return old_name;
}
-/* Register in MAP the rename tuple (OLD_NAME, EXPR). */
+/* Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR). */
void
-set_rename (htab_t map, tree old_name, tree expr)
+set_rename (htab_t rename_map, tree old_name, tree expr)
{
struct rename_map_elt_s tmp;
PTR *slot;
@@ -424,7 +424,7 @@ set_rename (htab_t map, tree old_name, tree expr)
return;
tmp.old_name = old_name;
- slot = htab_find_slot (map, &tmp, INSERT);
+ slot = htab_find_slot (rename_map, &tmp, INSERT);
if (!slot)
return;
@@ -435,10 +435,10 @@ set_rename (htab_t map, tree old_name, tree expr)
*slot = new_rename_map_elt (old_name, expr);
}
-/* Rename the SSA_NAMEs used in STMT and that appear in MAP. */
+/* Rename the SSA_NAMEs used in STMT and that appear in RENAME_MAP. */
static void
-rename_variables_in_stmt (gimple stmt, htab_t map, gimple_stmt_iterator *insert_gsi)
+rename_variables_in_stmt (gimple stmt, htab_t rename_map, gimple_stmt_iterator *insert_gsi)
{
ssa_op_iter iter;
use_operand_p use_p;
@@ -452,7 +452,7 @@ rename_variables_in_stmt (gimple stmt, htab_t map, gimple_stmt_iterator *insert_
if (TREE_CODE (use) != SSA_NAME)
continue;
- expr = get_rename (map, use);
+ expr = get_rename (rename_map, use);
if (use == expr)
continue;
@@ -522,7 +522,7 @@ expand_scalar_variables_expr (tree, tree, enum tree_code, tree, basic_block,
static tree
expand_scalar_variables_call (gimple stmt, basic_block bb, sese region,
- htab_t map, gimple_stmt_iterator *gsi)
+ htab_t rename_map, gimple_stmt_iterator *gsi)
{
int i, nargs = gimple_call_num_args (stmt);
VEC (tree, gc) *args = VEC_alloc (tree, gc, nargs);
@@ -538,7 +538,7 @@ expand_scalar_variables_call (gimple stmt, basic_block bb, sese region,
var = create_tmp_var (t, "var");
arg = expand_scalar_variables_expr (t, arg, TREE_CODE (arg), NULL,
- bb, region, map, gsi);
+ bb, region, rename_map, gsi);
arg = build2 (MODIFY_EXPR, t, var, arg);
arg = force_gimple_operand_gsi (gsi, arg, true, NULL,
true, GSI_SAME_STMT);
@@ -561,12 +561,12 @@ expand_scalar_variables_call (gimple stmt, basic_block bb, sese region,
the definition of OP0, that are defined outside BB and still in the
SESE, i.e. not a parameter of the SESE. The expression that is
returned contains only induction variables from the generated code:
- MAP contains the induction variables renaming mapping, and is used
+ RENAME_MAP contains the induction variables renaming mapping, and is used
to translate the names of induction variables. */
static tree
expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
- sese region, htab_t map,
+ sese region, htab_t rename_map,
gimple_stmt_iterator *gsi)
{
gimple def_stmt;
@@ -574,12 +574,12 @@ expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
if (is_parameter (region, op0)
|| is_iv (op0))
- return fold_convert (type, get_rename (map, op0));
+ return fold_convert (type, get_rename (rename_map, op0));
def_stmt = SSA_NAME_DEF_STMT (op0);
/* Check whether we already have a rename for OP0. */
- new_op = get_rename (map, op0);
+ new_op = get_rename (rename_map, op0);
if (new_op != op0
&& gimple_bb (SSA_NAME_DEF_STMT (new_op)) == bb)
@@ -590,7 +590,7 @@ expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
/* If the defining statement is in the basic block already
we do not need to create a new expression for it, we
only need to ensure its operands are expanded. */
- expand_scalar_variables_stmt (def_stmt, bb, region, map, gsi);
+ expand_scalar_variables_stmt (def_stmt, bb, region, rename_map, gsi);
return fold_convert (type, new_op);
}
else
@@ -609,11 +609,11 @@ expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
tree type = gimple_expr_type (def_stmt);
return expand_scalar_variables_expr (type, var0, subcode, var1, bb,
- region, map, gsi);
+ region, rename_map, gsi);
}
case GIMPLE_CALL:
- return expand_scalar_variables_call (def_stmt, bb, region, map, gsi);
+ return expand_scalar_variables_call (def_stmt, bb, region, rename_map, gsi);
default:
gcc_unreachable ();
@@ -627,13 +627,13 @@ expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
variables used in OP0 and OP1, defined outside BB and still defined
in the SESE, i.e. not a parameter of the SESE. The expression that
is returned contains only induction variables from the generated
- code: MAP contains the induction variables renaming mapping, and is
+ code: RENAME_MAP contains the induction variables renaming mapping, and is
used to translate the names of induction variables. */
static tree
expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
tree op1, basic_block bb, sese region,
- htab_t map, gimple_stmt_iterator *gsi)
+ htab_t rename_map, gimple_stmt_iterator *gsi)
{
if (TREE_CODE_CLASS (code) == tcc_constant
|| TREE_CODE_CLASS (code) == tcc_declaration)
@@ -650,7 +650,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
{
tree op = TREE_OPERAND (op0, 0);
tree res = expand_scalar_variables_expr
- (type, op, TREE_CODE (op), NULL, bb, region, map, gsi);
+ (type, op, TREE_CODE (op), NULL, bb, region, rename_map, gsi);
return build1 (code, type, res);
}
@@ -658,7 +658,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
{
tree old_name = TREE_OPERAND (op0, 0);
tree expr = expand_scalar_variables_ssa_name
- (type, old_name, bb, region, map, gsi);
+ (type, old_name, bb, region, rename_map, gsi);
if (TREE_CODE (expr) != SSA_NAME
&& is_gimple_reg (old_name))
@@ -682,10 +682,10 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
tree op03 = TREE_OPERAND (op0, 3);
tree base = expand_scalar_variables_expr
(TREE_TYPE (op00), op00, TREE_CODE (op00), NULL, bb, region,
- map, gsi);
+ rename_map, gsi);
tree subscript = expand_scalar_variables_expr
(TREE_TYPE (op01), op01, TREE_CODE (op01), NULL, bb, region,
- map, gsi);
+ rename_map, gsi);
return build4 (ARRAY_REF, type, base, subscript, op02, op03);
}
@@ -704,7 +704,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
tree op0_type = TREE_TYPE (op0);
enum tree_code op0_code = TREE_CODE (op0);
tree op0_expr = expand_scalar_variables_expr (op0_type, op0, op0_code,
- NULL, bb, region, map, gsi);
+ NULL, bb, region, rename_map, gsi);
return fold_build1 (code, type, op0_expr);
}
@@ -715,17 +715,17 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
tree op0_type = TREE_TYPE (op0);
enum tree_code op0_code = TREE_CODE (op0);
tree op0_expr = expand_scalar_variables_expr (op0_type, op0, op0_code,
- NULL, bb, region, map, gsi);
+ NULL, bb, region, rename_map, gsi);
tree op1_type = TREE_TYPE (op1);
enum tree_code op1_code = TREE_CODE (op1);
tree op1_expr = expand_scalar_variables_expr (op1_type, op1, op1_code,
- NULL, bb, region, map, gsi);
+ NULL, bb, region, rename_map, gsi);
return fold_build2 (code, type, op0_expr, op1_expr);
}
if (code == SSA_NAME)
- return expand_scalar_variables_ssa_name (type, op0, bb, region, map, gsi);
+ return expand_scalar_variables_ssa_name (type, op0, bb, region, rename_map, gsi);
if (code == ADDR_EXPR)
{
@@ -736,7 +736,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
{
tree e = expand_scalar_variables_expr (TREE_TYPE (op00), op00,
TREE_CODE (op00),
- NULL, bb, region, map, gsi);
+ NULL, bb, region, rename_map, gsi);
return fold_build1 (code, TREE_TYPE (op0), e);
}
@@ -751,13 +751,13 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
STMT depends on in the SESE: these are all the scalar variables used
in STMT, defined outside BB and still defined in the SESE, i.e. not a
parameter of the SESE. The expression that is returned contains
- only induction variables from the generated code: MAP contains the
+ only induction variables from the generated code: RENAME_MAP contains the
induction variables renaming mapping, and is used to translate the
names of induction variables. */
static void
expand_scalar_variables_stmt (gimple stmt, basic_block bb, sese region,
- htab_t map, gimple_stmt_iterator *gsi)
+ htab_t rename_map, gimple_stmt_iterator *gsi)
{
ssa_op_iter iter;
use_operand_p use_p;
@@ -773,12 +773,12 @@ expand_scalar_variables_stmt (gimple stmt, basic_block bb, sese region,
continue;
/* Don't expand USE if we already have a rename for it. */
- use_expr = get_rename (map, use);
+ use_expr = get_rename (rename_map, use);
if (use_expr != use)
continue;
use_expr = expand_scalar_variables_expr (type, use, code, NULL, bb,
- region, map, gsi);
+ region, rename_map, gsi);
use_expr = fold_convert (type, use_expr);
if (use_expr == use)
@@ -813,33 +813,33 @@ expand_scalar_variables_stmt (gimple stmt, basic_block bb, sese region,
BB depends on in the SESE: these are all the scalar variables used
in BB, defined outside BB and still defined in the SESE, i.e. not a
parameter of the SESE. The expression that is returned contains
- only induction variables from the generated code: MAP contains the
+ only induction variables from the generated code: RENAME_MAP contains the
induction variables renaming mapping, and is used to translate the
names of induction variables. */
static void
-expand_scalar_variables (basic_block bb, sese region, htab_t map)
+expand_scalar_variables (basic_block bb, sese region, htab_t rename_map)
{
gimple_stmt_iterator gsi;
for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi);)
{
gimple stmt = gsi_stmt (gsi);
- expand_scalar_variables_stmt (stmt, bb, region, map, &gsi);
+ expand_scalar_variables_stmt (stmt, bb, region, rename_map, &gsi);
gsi_next (&gsi);
}
}
-/* Rename all the SSA_NAMEs from block BB according to the MAP. */
+/* Rename all the SSA_NAMEs from block BB according to the RENAME_MAP. */
static void
-rename_variables (basic_block bb, htab_t map)
+rename_variables (basic_block bb, htab_t rename_map)
{
gimple_stmt_iterator gsi;
gimple_stmt_iterator insert_gsi = gsi_start_bb (bb);
for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- rename_variables_in_stmt (gsi_stmt (gsi), map, &insert_gsi);
+ rename_variables_in_stmt (gsi_stmt (gsi), rename_map, &insert_gsi);
}
/* Remove condition from BB. */
@@ -1172,7 +1172,7 @@ insert_guard_phis (basic_block bb, edge true_edge, edge false_edge,
preserve SSA form. */
static void
-graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t map)
+graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t rename_map)
{
gimple_stmt_iterator gsi, gsi_tgt;
@@ -1202,7 +1202,7 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t map)
{
tree old_name = DEF_FROM_PTR (def_p);
tree new_name = create_new_def_for (old_name, copy, def_p);
- set_rename (map, old_name, new_name);
+ set_rename (rename_map, old_name, new_name);
}
}
}
@@ -1213,16 +1213,16 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t map)
edge
copy_bb_and_scalar_dependences (basic_block bb, sese region,
- edge next_e, htab_t map)
+ edge next_e, htab_t rename_map)
{
basic_block new_bb = split_edge (next_e);
next_e = single_succ_edge (new_bb);
- graphite_copy_stmts_from_block (bb, new_bb, map);
+ graphite_copy_stmts_from_block (bb, new_bb, rename_map);
remove_condition (new_bb);
remove_phi_nodes (new_bb);
- expand_scalar_variables (new_bb, region, map);
- rename_variables (new_bb, map);
+ expand_scalar_variables (new_bb, region, rename_map);
+ rename_variables (new_bb, rename_map);
return next_e;
}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 31/65] Partially removing cloog.h and graphite-clast-to-gimple.h where possible. Removing unused function check_poly_representation.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (27 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 11/65] Launch dotty in background Sebastian Pop
@ 2010-08-02 20:23 ` Sebastian Pop
2010-08-02 20:23 ` [PATCH 28/65] Print bbs in refined region tree Sebastian Pop
` (38 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:23 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-05 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-cloog-util.h: Added cloog.h.
* graphite-blocking.c: Removed cloog.h.
* graphite-dependences.c: Same.
* graphite-interchange.c: Same.
* graphite-poly.c: Same.
* graphite-ppl.c: Same.
* graphite-scop-detection.c: Same.
* graphite-sese-to-poly.c:
Removed cloog.h.
Removed graphite-clast-to-gimple.h.
(check_poly_representation): Removed (unused).
* graphite-sese-to-poly.h
(check_poly_representation): Removed (unused).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161865 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 16 ++++++++++++++++
gcc/ChangeLog.graphite | 16 ++++++++++++++++
gcc/graphite-blocking.c | 1 -
gcc/graphite-cloog-util.h | 2 ++
gcc/graphite-dependences.c | 1 -
gcc/graphite-interchange.c | 1 -
gcc/graphite-poly.c | 1 -
gcc/graphite-ppl.c | 1 -
gcc/graphite-scop-detection.c | 1 -
gcc/graphite-sese-to-poly.c | 14 --------------
gcc/graphite-sese-to-poly.h | 1 -
11 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index caf4aa4..b0f30f1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,21 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-cloog-util.h: Added cloog.h.
+ * graphite-blocking.c: Removed cloog.h.
+ * graphite-dependences.c: Same.
+ * graphite-interchange.c: Same.
+ * graphite-poly.c: Same.
+ * graphite-ppl.c: Same.
+ * graphite-scop-detection.c: Same.
+ * graphite-sese-to-poly.c:
+ Removed cloog.h.
+ Removed graphite-clast-to-gimple.h.
+ (check_poly_representation): Removed (unused).
+ * graphite-sese-to-poly.h
+ (check_poly_representation): Removed (unused).
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* Makefile.in (OBJS-common): Added graphite-cloog-util.o.
(graphite-clast-to-gimple.o): Added graphite-cloog-util.h.
(graphite-cloog-util.o): New.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b1c1e8e..5ef7688 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,21 @@
2010-07-05 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-cloog-util.h: Added cloog.h.
+ * graphite-blocking.c: Removed cloog.h.
+ * graphite-dependences.c: Same.
+ * graphite-interchange.c: Same.
+ * graphite-poly.c: Same.
+ * graphite-ppl.c: Same.
+ * graphite-scop-detection.c: Same.
+ * graphite-sese-to-poly.c:
+ Removed cloog.h.
+ Removed graphite-clast-to-gimple.h.
+ (check_poly_representation): Removed (unused).
+ * graphite-sese-to-poly.h
+ (check_poly_representation): Removed (unused).
+
+2010-07-05 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* Makefile.in
(OBJS-common): Added graphite-cloog-util.o.
(graphite-clast-to-gimple.o): Added graphite-cloog-util.h.
diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c
index 769cda4..deb25ec 100644
--- a/gcc/graphite-blocking.c
+++ b/gcc/graphite-blocking.c
@@ -46,7 +46,6 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#ifdef HAVE_cloog
-#include "cloog/cloog.h"
#include "ppl_c.h"
#include "sese.h"
#include "graphite-ppl.h"
diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
index 17a3be4..3180b0e 100644
--- a/gcc/graphite-cloog-util.h
+++ b/gcc/graphite-cloog-util.h
@@ -21,6 +21,8 @@ along with GCC; see the file COPYING3. If not see
#ifndef GRAPHITE_CLOOG_UTIL_H
#define GRAPHITE_CLOOG_UTIL_H
+#include "cloog/cloog.h"
+
CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset (
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index af4c962..3f13ac3 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -42,7 +42,6 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#ifdef HAVE_cloog
-#include "cloog/cloog.h"
#include "ppl_c.h"
#include "sese.h"
#include "graphite-ppl.h"
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c
index de3bf25..2392ce8 100644
--- a/gcc/graphite-interchange.c
+++ b/gcc/graphite-interchange.c
@@ -46,7 +46,6 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#ifdef HAVE_cloog
-#include "cloog/cloog.h"
#include "ppl_c.h"
#include "sese.h"
#include "graphite-ppl.h"
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 5c4a6f9..67b9384 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -46,7 +46,6 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#ifdef HAVE_cloog
-#include "cloog/cloog.h"
#include "ppl_c.h"
#include "sese.h"
#include "graphite-ppl.h"
diff --git a/gcc/graphite-ppl.c b/gcc/graphite-ppl.c
index 9dd98bb..f87f345 100644
--- a/gcc/graphite-ppl.c
+++ b/gcc/graphite-ppl.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see
#ifdef HAVE_cloog
#include "ppl_c.h"
-#include "cloog/cloog.h"
#include "graphite-cloog-util.h"
#include "graphite-ppl.h"
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 36a5215..baa4c34 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -44,7 +44,6 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#ifdef HAVE_cloog
-#include "cloog/cloog.h"
#include "ppl_c.h"
#include "graphite-ppl.h"
#include "graphite.h"
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 62064c4..ac251ab 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -43,13 +43,11 @@ along with GCC; see the file COPYING3. If not see
#include "sese.h"
#ifdef HAVE_cloog
-#include "cloog/cloog.h"
#include "ppl_c.h"
#include "graphite-ppl.h"
#include "graphite.h"
#include "graphite-poly.h"
#include "graphite-scop-detection.h"
-#include "graphite-clast-to-gimple.h"
#include "graphite-sese-to-poly.h"
/* Check if VAR is used in a phi node, that is no loop header. */
@@ -3028,16 +3026,4 @@ build_poly_scop (scop_p scop)
representation. */
POLY_SCOP_P (scop) = true;
}
-
-/* Always return false. Exercise the scop_to_clast function. */
-
-void
-check_poly_representation (scop_p scop ATTRIBUTE_UNUSED)
-{
-#ifdef ENABLE_CHECKING
- cloog_prog_clast pc = scop_to_clast (scop);
- cloog_clast_free (pc.stmt);
- cloog_program_free (pc.prog);
-#endif
-}
#endif
diff --git a/gcc/graphite-sese-to-poly.h b/gcc/graphite-sese-to-poly.h
index 558a283..b0053d0 100644
--- a/gcc/graphite-sese-to-poly.h
+++ b/gcc/graphite-sese-to-poly.h
@@ -29,7 +29,6 @@ struct base_alias_pair
};
void build_poly_scop (scop_p);
-void check_poly_representation (scop_p);
void rewrite_commutative_reductions_out_of_ssa (sese, sbitmap);
void rewrite_reductions_out_of_ssa (scop_p);
void rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 34/65] Remove insert_loop_close_phis.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (36 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 43/65] Correctly handle SSA_NAME_IS_DEFAULT_DEF in rewrite_close_phi_out_of_ssa Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 51/65] Do not instantiate default definitions in instantiate_scev_name Sebastian Pop
` (29 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (translate_clast_for_loop): Do not call
insert_loop_close_phis.
* sese.c (name_defined_in_loop_p): Removed.
(expr_defined_in_loop_p): Removed.
(alive_after_loop): Removed.
(close_phi_not_yet_inserted_p): Removed.
(struct alep): Removed.
(add_loop_exit_phis): Removed.
(insert_loop_close_phis): Removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162242 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 12 +++
gcc/ChangeLog.graphite | 19 ++++-
gcc/graphite-clast-to-gimple.c | 4 -
gcc/sese.c | 167 ----------------------------------------
4 files changed, 27 insertions(+), 175 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c93abbf..301c7a3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (translate_clast_for_loop): Do not call
+ insert_loop_close_phis.
+ * sese.c (name_defined_in_loop_p): Removed.
+ (expr_defined_in_loop_p): Removed.
+ (alive_after_loop): Removed.
+ (close_phi_not_yet_inserted_p): Removed.
+ (struct alep): Removed.
+ (add_loop_exit_phis): Removed.
+ (insert_loop_close_phis): Removed.
+
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-cloog-util.c
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 806d67e..2cd80ee 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,9 +1,20 @@
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-clast-to-gimple.c (translate_clast_for_loop): Do not call
+ insert_loop_close_phis.
+ * sese.c (name_defined_in_loop_p): Removed.
+ (expr_defined_in_loop_p): Removed.
+ (alive_after_loop): Removed.
+ (close_phi_not_yet_inserted_p): Removed.
+ (struct alep): Removed.
+ (add_loop_exit_phis): Removed.
+ (insert_loop_close_phis): Removed.
+
2010-07-15 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
- * graphite-cloog-util.c
- (cloog_matrix_to_ppl_constraint): Fix flipped condition.
- * graphite-poly.c
- (psct_scattering_dim_for_loop_depth): Same.
+ * graphite-cloog-util.c (cloog_matrix_to_ppl_constraint): Fix flipped
+ condition.
+ * graphite-poly.c (psct_scattering_dim_for_loop_depth): Same.
2010-07-07 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index f1d7475..80d602f 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1044,10 +1044,6 @@ translate_clast_for_loop (sese region, loop_p context_loop,
redirect_edge_succ_nodup (next_e, after);
set_immediate_dominator (CDI_DOMINATORS, next_e->dest, next_e->src);
- /* Remove from rename_map all the tuples containing variables
- defined in loop's body. */
- insert_loop_close_phis (rename_map, loop);
-
if (flag_loop_parallelize_all
&& !dependency_in_loop_p (loop, bb_pbb_mapping,
get_scattering_level (level)))
diff --git a/gcc/sese.c b/gcc/sese.c
index a68ede5..420776d 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -888,173 +888,6 @@ get_false_edge_from_guard_bb (basic_block bb)
return NULL;
}
-/* Returns true when NAME is defined in LOOP. */
-
-static bool
-name_defined_in_loop_p (tree name, loop_p loop)
-{
- return !SSA_NAME_IS_DEFAULT_DEF (name)
- && gimple_bb (SSA_NAME_DEF_STMT (name))->loop_father == loop;
-}
-
-/* Returns true when EXPR contains SSA_NAMEs defined in LOOP. */
-
-static bool
-expr_defined_in_loop_p (tree expr, loop_p loop)
-{
- switch (TREE_CODE_LENGTH (TREE_CODE (expr)))
- {
- case 3:
- return expr_defined_in_loop_p (TREE_OPERAND (expr, 0), loop)
- || expr_defined_in_loop_p (TREE_OPERAND (expr, 1), loop)
- || expr_defined_in_loop_p (TREE_OPERAND (expr, 2), loop);
-
- case 2:
- return expr_defined_in_loop_p (TREE_OPERAND (expr, 0), loop)
- || expr_defined_in_loop_p (TREE_OPERAND (expr, 1), loop);
-
- case 1:
- return expr_defined_in_loop_p (TREE_OPERAND (expr, 0), loop);
-
- case 0:
- return TREE_CODE (expr) == SSA_NAME
- && name_defined_in_loop_p (expr, loop);
-
- default:
- return false;
- }
-}
-
-/* Returns the gimple statement that uses NAME outside the loop it is
- defined in, returns NULL if there is no such loop close phi node.
- An invariant of the loop closed SSA form is that the only use of a
- variable, outside the loop it is defined in, is in the loop close
- phi node that just follows the loop. */
-
-static gimple
-alive_after_loop (tree name)
-{
- use_operand_p use_p;
- imm_use_iterator imm_iter;
- loop_p loop = gimple_bb (SSA_NAME_DEF_STMT (name))->loop_father;
-
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, name)
- {
- gimple stmt = USE_STMT (use_p);
-
- if (gimple_code (stmt) == GIMPLE_PHI
- && gimple_bb (stmt)->loop_father != loop)
- return stmt;
- }
-
- return NULL;
-}
-
-/* Return true if a close phi has not yet been inserted for the use of
- variable NAME on the single exit of LOOP. */
-
-static bool
-close_phi_not_yet_inserted_p (loop_p loop, tree name)
-{
- gimple_stmt_iterator psi;
- basic_block bb = single_exit (loop)->dest;
-
- for (psi = gsi_start_phis (bb); !gsi_end_p (psi); gsi_next (&psi))
- if (gimple_phi_arg_def (gsi_stmt (psi), 0) == name)
- return false;
-
- return true;
-}
-
-/* A structure for passing parameters to add_loop_exit_phis. */
-
-typedef struct alep {
- loop_p loop;
- VEC (rename_map_elt, heap) *new_renames;
-} *alep_p;
-
-/* Helper function for htab_traverse in insert_loop_close_phis. */
-
-static int
-add_loop_exit_phis (void **slot, void *data)
-{
- struct rename_map_elt_s *entry;
- alep_p a;
- loop_p loop;
- tree expr, new_name, old_name;
- bool def_in_loop_p, used_outside_p, need_close_phi_p;
- gimple old_close_phi;
-
- if (!slot || !*slot || !data)
- return 1;
-
- entry = (struct rename_map_elt_s *) *slot;
- a = (alep_p) data;
- loop = a->loop;
- new_name = expr = entry->expr;
- old_name = entry->old_name;
-
- def_in_loop_p = expr_defined_in_loop_p (expr, loop);
- if (!def_in_loop_p)
- return 1;
-
- /* Remove the old rename from the map when the expression is defined
- in the loop that we're closing. */
- free (*slot);
- *slot = NULL;
-
- if (TREE_CODE (expr) != SSA_NAME)
- return 1;
-
- old_close_phi = alive_after_loop (old_name);
- used_outside_p = (old_close_phi != NULL);
- need_close_phi_p = (used_outside_p
- && close_phi_not_yet_inserted_p (loop, new_name));
-
- /* Insert a loop close phi node. */
- if (need_close_phi_p)
- {
- basic_block bb = single_exit (loop)->dest;
- gimple phi = create_phi_node (new_name, bb);
- tree new_res = create_new_def_for (gimple_phi_result (phi), phi,
- gimple_phi_result_ptr (phi));
-
- add_phi_arg (phi, new_name, single_pred_edge (bb), UNKNOWN_LOCATION);
- VEC_safe_push (rename_map_elt, heap, a->new_renames,
- new_rename_map_elt (gimple_phi_result (old_close_phi),
- new_res));
- }
-
- return 1;
-}
-
-/* Traverses MAP and removes from it all the tuples (OLD, NEW) where
- NEW is defined in LOOP. Inserts on the exit of LOOP the close phi
- node "RES = phi (NEW)" corresponding to "OLD_RES = phi (OLD)" in
- the original code. Inserts in MAP the tuple (OLD_RES, RES). */
-
-void
-insert_loop_close_phis (htab_t map, loop_p loop)
-{
- int i;
- struct alep a;
- rename_map_elt elt;
-
- a.loop = loop;
- a.new_renames = VEC_alloc (rename_map_elt, heap, 3);
- update_ssa (TODO_update_ssa);
- htab_traverse (map, add_loop_exit_phis, &a);
- update_ssa (TODO_update_ssa);
-
- for (i = 0; VEC_iterate (rename_map_elt, a.new_renames, i, elt); i++)
- {
- set_rename (map, elt->old_name, elt->expr);
- free (elt);
- }
-
- VEC_free (rename_map_elt, heap, a.new_renames);
-}
-
/* Helper structure for htab_traverse in insert_guard_phis. */
struct igp {
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 22/65] Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (45 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 46/65] Add testcase for PR20742 Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 47/65] Do not translate out-of-SSA close phi nodes that can be analyzed with scev Sebastian Pop
` (20 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Moved up.
(rewrite_cross_bb_phi_deps): Split out of rewrite_cross_bb_scalar_deps.
(rewrite_cross_bb_scalar_deps_out_of_ssa): Run rewrite_cross_bb_phi_deps
before rewrite_cross_bb_scalar_deps.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161295 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 7 +++
gcc/ChangeLog.graphite | 7 +++
gcc/graphite-sese-to-poly.c | 96 ++++++++++++++++++++++++++++---------------
3 files changed, 77 insertions(+), 33 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6f1a9c6..f12de88 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Moved up.
+ (rewrite_cross_bb_phi_deps): Split out of rewrite_cross_bb_scalar_deps.
+ (rewrite_cross_bb_scalar_deps_out_of_ssa): Run rewrite_cross_bb_phi_deps
+ before rewrite_cross_bb_scalar_deps.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa):
Early return in when flag_associative_math is not set.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 53c7344..d736895 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Moved up.
+ (rewrite_cross_bb_phi_deps): Split out of rewrite_cross_bb_scalar_deps.
+ (rewrite_cross_bb_scalar_deps_out_of_ssa): Run rewrite_cross_bb_phi_deps
+ before rewrite_cross_bb_scalar_deps.
+
+2010-06-23 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_commutative_reductions_out_of_ssa):
Early return in when flag_associative_math is not set.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 9aa4070..5f99f65 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2272,6 +2272,31 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi)
gsi_insert_seq_before (&gsi, stmts, GSI_NEW_STMT);
}
+/* Rewrite out of SSA all the reduction phi nodes of SCOP. */
+
+void
+rewrite_reductions_out_of_ssa (scop_p scop)
+{
+ basic_block bb;
+ gimple_stmt_iterator psi;
+ sese region = SCOP_REGION (scop);
+
+ FOR_EACH_BB (bb)
+ if (bb_in_sese_p (bb, region))
+ for (psi = gsi_start_phis (bb); !gsi_end_p (psi);)
+ {
+ if (scalar_close_phi_node_p (gsi_stmt (psi)))
+ rewrite_close_phi_out_of_ssa (&psi);
+ else if (reduction_phi_p (region, &psi))
+ rewrite_phi_out_of_ssa (&psi);
+ }
+
+ update_ssa (TODO_update_ssa);
+#ifdef ENABLE_CHECKING
+ verify_loop_closed_ssa (true);
+#endif
+}
+
/* Return true when DEF can be analyzed in REGION by the scalar
evolution analyzer. */
@@ -2314,16 +2339,16 @@ rewrite_cross_bb_scalar_dependence (tree zero_dim_array, tree def, gimple use_st
}
/* Rewrite the scalar dependences crossing the boundary of the BB
- containing STMT with an array. */
+ containing STMT with an array. GSI points to a definition that is
+ used in a PHI node. */
static void
-rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
+rewrite_cross_bb_phi_deps (sese region, gimple_stmt_iterator gsi)
{
- gimple stmt = gsi_stmt (*gsi);
+ gimple stmt = gsi_stmt (gsi);
imm_use_iterator imm_iter;
tree def;
basic_block def_bb;
- tree zero_dim_array = NULL_TREE;
gimple use_stmt;
if (gimple_code (stmt) != GIMPLE_ASSIGN)
@@ -2342,9 +2367,37 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
gimple_stmt_iterator si = gsi_for_stmt (use_stmt);
rewrite_phi_out_of_ssa (&si);
}
- else if (def_bb != gimple_bb (use_stmt)
- && !is_gimple_debug (use_stmt))
+}
+
+/* Rewrite the scalar dependences crossing the boundary of the BB
+ containing STMT with an array. */
+
+static void
+rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+ imm_use_iterator imm_iter;
+ tree def;
+ basic_block def_bb;
+ tree zero_dim_array = NULL_TREE;
+ gimple use_stmt;
+
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
+ return;
+
+ def = gimple_assign_lhs (stmt);
+ if (!is_gimple_reg (def)
+ || scev_analyzable_p (def, region))
+ return;
+
+ def_bb = gimple_bb (stmt);
+
+ FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
+ if (def_bb != gimple_bb (use_stmt)
+ && !is_gimple_debug (use_stmt))
{
+ gcc_assert (gimple_code (use_stmt) != GIMPLE_PHI);
+
if (!zero_dim_array)
{
zero_dim_array = create_zero_dim_array
@@ -2361,32 +2414,6 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
/* Rewrite out of SSA all the reduction phi nodes of SCOP. */
void
-rewrite_reductions_out_of_ssa (scop_p scop)
-{
- basic_block bb;
- gimple_stmt_iterator psi;
- sese region = SCOP_REGION (scop);
-
- FOR_EACH_BB (bb)
- if (bb_in_sese_p (bb, region))
- for (psi = gsi_start_phis (bb); !gsi_end_p (psi);)
- {
- if (scalar_close_phi_node_p (gsi_stmt (psi)))
- rewrite_close_phi_out_of_ssa (&psi);
- else if (reduction_phi_p (region, &psi))
- rewrite_phi_out_of_ssa (&psi);
- }
-
- update_ssa (TODO_update_ssa);
-#ifdef ENABLE_CHECKING
- verify_loop_closed_ssa (true);
-#endif
-}
-
-
-/* Rewrite out of SSA all the reduction phi nodes of SCOP. */
-
-void
rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p scop)
{
basic_block bb;
@@ -2396,7 +2423,10 @@ rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p scop)
FOR_EACH_BB (bb)
if (bb_in_sese_p (bb, region))
for (psi = gsi_start_bb (bb); !gsi_end_p (psi); gsi_next (&psi))
- rewrite_cross_bb_scalar_deps (region, &psi);
+ {
+ rewrite_cross_bb_phi_deps (region, psi);
+ rewrite_cross_bb_scalar_deps (region, &psi);
+ }
update_ssa (TODO_update_ssa);
#ifdef ENABLE_CHECKING
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 36/65] chrec_apply should only apply to the specified variable.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (33 preceding siblings ...)
2010-08-02 20:23 ` [PATCH 40/65] Scevs could be expressions without chrecs and still be scev_analyzable_p Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 39/65] Bump the size of scevs Sebastian Pop
` (32 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* tree-chrec.c (chrec_apply): Should only apply to the specified
variable. Also handle multivariate chains of recurrences that
satisfy evolution_function_is_affine_p. Also handle CASE_CONVERT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162244 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 6 ++++++
gcc/ChangeLog.graphite | 6 ++++++
gcc/tree-chrec.c | 45 +++++++++++++++++++++++++++++++--------------
3 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ec0f773..46b7c59 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * tree-chrec.c (chrec_apply): Should only apply to the specified
+ variable. Also handle multivariate chains of recurrences that
+ satisfy evolution_function_is_affine_p. Also handle CASE_CONVERT.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (debug_clast_name_index): Removed.
(debug_clast_name_indexes_1): Removed.
(debug_clast_name_indexes): Removed.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 3c7615b..c46bd70 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,11 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * tree-chrec.c (chrec_apply): Should only apply to the specified
+ variable. Also handle multivariate chains of recurrences that
+ satisfy evolution_function_is_affine_p. Also handle CASE_CONVERT.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (debug_clast_name_index): Removed.
(debug_clast_name_indexes_1): Removed.
(debug_clast_name_indexes): Removed.
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index c92b6b9..92f8de9 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -599,23 +599,40 @@ chrec_apply (unsigned var,
if (TREE_CODE (x) == INTEGER_CST && SCALAR_FLOAT_TYPE_P (type))
x = build_real_from_int_cst (type, x);
- if (evolution_function_is_affine_p (chrec))
+ switch (TREE_CODE (chrec))
{
- /* "{a, +, b} (x)" -> "a + b*x". */
- x = chrec_convert_rhs (type, x, NULL);
- res = chrec_fold_multiply (TREE_TYPE (x), CHREC_RIGHT (chrec), x);
- res = chrec_fold_plus (type, CHREC_LEFT (chrec), res);
- }
+ case POLYNOMIAL_CHREC:
+ if (evolution_function_is_affine_p (chrec))
+ {
+ if (CHREC_VARIABLE (chrec) != var)
+ return build_polynomial_chrec
+ (CHREC_VARIABLE (chrec),
+ chrec_apply (var, CHREC_LEFT (chrec), x),
+ chrec_apply (var, CHREC_RIGHT (chrec), x));
+
+ /* "{a, +, b} (x)" -> "a + b*x". */
+ x = chrec_convert_rhs (type, x, NULL);
+ res = chrec_fold_multiply (TREE_TYPE (x), CHREC_RIGHT (chrec), x);
+ res = chrec_fold_plus (type, CHREC_LEFT (chrec), res);
+ }
+ else if (TREE_CODE (x) == INTEGER_CST
+ && tree_int_cst_sgn (x) == 1)
+ /* testsuite/.../ssa-chrec-38.c. */
+ res = chrec_evaluate (var, chrec, x, 0);
+ else
+ res = chrec_dont_know;
+ break;
- else if (TREE_CODE (chrec) != POLYNOMIAL_CHREC)
- res = chrec;
+ CASE_CONVERT:
+ res = chrec_convert (TREE_TYPE (chrec),
+ chrec_apply (var, TREE_OPERAND (chrec, 0), x),
+ NULL);
+ break;
- else if (TREE_CODE (x) == INTEGER_CST
- && tree_int_cst_sgn (x) == 1)
- /* testsuite/.../ssa-chrec-38.c. */
- res = chrec_evaluate (var, chrec, x, 0);
- else
- res = chrec_dont_know;
+ default:
+ res = chrec;
+ break;
+ }
if (dump_file && (dump_flags & TDF_DETAILS))
{
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 46/65] Add testcase for PR20742.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (44 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 29/65] Resolve CLooG's value_* macros to their respective mpz_* counterparts Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 22/65] Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps Sebastian Pop
` (21 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-20 Sebastian Pop <sebastian.pop@amd.com>
* gcc.dg/tree-ssa/pr20742.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162350 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 4 ++++
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gcc.dg/tree-ssa/pr20742.c | 18 ++++++++++++++++++
3 files changed, 26 insertions(+), 0 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20742.c
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index d929c9a..5e36bc3 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,7 @@
+2010-07-20 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gcc.dg/tree-ssa/pr20742.c: New.
+
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* sese.c (rename_uses): Call unshare_expr before force_gimple_operand.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 69e8a4c..9177c57 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/tree-ssa/pr20742.c: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/id-23.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20742.c b/gcc/testsuite/gcc.dg/tree-ssa/pr20742.c
new file mode 100644
index 0000000..21d6eb6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr20742.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define TEN(x) x x x x x x x x x x
+#define THOUSAND(x) TEN (TEN (TEN (x)))
+
+int
+foo (int x, int y)
+{
+ register int a = y + 57;
+ register int b = y + 31;
+
+ while (x-- > 0)
+ {
+ THOUSAND (a += b; b -= a;)
+ }
+ return a + b;
+}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 48/65] Dot refined regions.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (42 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 35/65] Remove expand_scalar_variables_ hack Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 29/65] Resolve CLooG's value_* macros to their respective mpz_* counterparts Sebastian Pop
` (23 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-20 Vladimir Kargov <kargov@gmail.com>
* refined-regions.c: Include tree-pass.h, cfgloop.h, gimple.h, and
tree-data-ref.h.
(dot_regions_1): New.
(dot_regions): New.
* refined-regions.h (dot_regions): Declared.
* Makefile.in (refined-regions.o): Update dependences.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162352 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 24c88d5..e4d59ce 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,12 @@
+2010-07-20 Vladimir Kargov <kargov@gmail.com>
+
+ * refined-regions.c: Include tree-pass.h, cfgloop.h, gimple.h, and
+ tree-data-ref.h.
+ (dot_regions_1): New.
+ (dot_regions): New.
+ * refined-regions.h (dot_regions): Declared.
+ * Makefile.in (refined-regions.o): Update dependences.
+
2010-07-20 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add an
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 44/65] Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (39 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 52/65] Use SSA_NAME_DEF_STMT only on SSA_NAMEs Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 49/65] Add loop_exits_from_bb_p Sebastian Pop
` (26 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
SSA scalar phi nodes that can be scev_analyzable_p.
* gfortran.dg/graphite/id-20.f: Adjust testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162252 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 7 +++++++
gcc/graphite-sese-to-poly.c | 20 ++++----------------
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gfortran.dg/graphite/id-20.f | 12 +++++++++---
5 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0433d9b..f153d76 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
+ SSA scalar phi nodes that can be scev_analyzable_p.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly
handle SSA_NAME_IS_DEFAULT_DEF.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 27cacc0..1ddd731 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
+ SSA scalar phi nodes that can be scev_analyzable_p.
+
+ * gfortran.dg/graphite/id-20.f: Adjust testcase.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly
handle SSA_NAME_IS_DEFAULT_DEF.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 0420285..7244ba9 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -165,8 +165,6 @@ static bool
reduction_phi_p (sese region, gimple_stmt_iterator *psi)
{
loop_p loop;
- tree scev;
- affine_iv iv;
gimple phi = gsi_stmt (*psi);
tree res = gimple_phi_result (phi);
@@ -189,11 +187,11 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
return false;
}
- /* Main induction variables with constant strides in LOOP are not
- reductions. */
- if (simple_iv (loop, loop, res, &iv, true))
+ if (scev_analyzable_p (res, region))
{
- if (integer_zerop (iv.step))
+ tree scev = scalar_evolution_in_region (region, loop, res);
+
+ if (evolution_function_is_invariant_p (scev, loop->num))
remove_invariant_phi (region, psi);
else
gsi_next (psi);
@@ -201,16 +199,6 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
return false;
}
- scev = scalar_evolution_in_region (region, loop, res);
- if (chrec_contains_undetermined (scev))
- return true;
-
- if (evolution_function_is_invariant_p (scev, loop->num))
- {
- remove_invariant_phi (region, psi);
- return false;
- }
-
/* All the other cases are considered reductions. */
return true;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 76288ae..c56694e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gfortran.dg/graphite/id-20.f: Adjust testcase.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/pr42729.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-20.f b/gcc/testsuite/gfortran.dg/graphite/id-20.f
index 110ae3f..795cb1b 100644
--- a/gcc/testsuite/gfortran.dg/graphite/id-20.f
+++ b/gcc/testsuite/gfortran.dg/graphite/id-20.f
@@ -1,4 +1,10 @@
- DO 32 MB=1,NVIRA
- * PVIRA(MA,MB)*(EA(MA+NOA)+EA(MB+NOA))*PT5
- 32 CONTINUE
+! { dg-options "-O3 -ffast-math" }
+
+ DIMENSION FPQR(25,25,25)
+ INTEGER P,Q,R
+ DO 130 R=1,N4MAX,2
+ IF(P.GT.1) THEN
+ FPQR(P,Q,R)= RM2*FPQR(P,Q,R-2)*REC(P+Q+R-2)
+ END IF
+ 130 RM2= RM2+TWO
END
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 52/65] Use SSA_NAME_DEF_STMT only on SSA_NAMEs.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (38 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 51/65] Do not instantiate default definitions in instantiate_scev_name Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 44/65] Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p Sebastian Pop
` (27 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
SSA_NAME_DEF_STMT only on SSA_NAMEs.
* gcc.dg/graphite/id-24.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162445 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 7 +++++++
gcc/graphite-sese-to-poly.c | 3 ++-
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gcc.dg/graphite/id-24.c | 22 ++++++++++++++++++++++
5 files changed, 40 insertions(+), 1 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-24.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ff88292..bc50e30 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
+ SSA_NAME_DEF_STMT only on SSA_NAMEs.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* tree-scalar-evolution.c (instantiate_scev_name): Do not
instantiate default definitions.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 155e396..1ae2bf2 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
+ SSA_NAME_DEF_STMT only on SSA_NAMEs.
+
+ * gcc.dg/graphite/id-24.c: New.
+
+2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
+
* tree-scalar-evolution.c (instantiate_scev_name): Do not
instantiate default definitions.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 81b2dc2..084dd31 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2256,7 +2256,8 @@ rewrite_phi_out_of_ssa (gimple_stmt_iterator *psi)
/* Avoid the insertion of code in the loop latch to please the
pattern matching of the vectorizer. */
- if (e->src == bb->loop_father->latch)
+ if (TREE_CODE (arg) == SSA_NAME
+ && e->src == bb->loop_father->latch)
insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
else
insert_out_of_ssa_copy_on_edge (e, zero_dim_array, arg);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9177c57..8bdc024 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/id-24.c: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/tree-ssa/pr20742.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/id-24.c b/gcc/testsuite/gcc.dg/graphite/id-24.c
new file mode 100644
index 0000000..d466069
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-24.c
@@ -0,0 +1,22 @@
+/* gcc.dg/tree-ssa/loadpre23.c used to ICE with Graphite. */
+
+struct {
+ int a;
+ int large[100];
+} x;
+
+int foo(int argc)
+{
+ int b;
+ int c;
+ int i;
+ int d, e;
+
+ for (i = 0; i < argc; i++)
+ {
+ e = x.a;
+ x.a = 9;
+ }
+ return d + e;
+}
+
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 35/65] Remove expand_scalar_variables_ hack.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (41 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 49/65] Add loop_exits_from_bb_p Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 48/65] Dot refined regions Sebastian Pop
` (24 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (debug_clast_name_index): Removed.
(debug_clast_name_indexes_1): Removed.
(debug_clast_name_indexes): Removed.
(pbb_to_depth_to_oldiv): Removed.
(build_iv_mapping): Replace the use of rename_map with iv_map.
(translate_clast_user): Remove uses of rename_map. Allocate and
free iv_map.
(translate_clast_for_loop): Remove uses of rename_map.
(translate_clast_for): Same.
(translate_clast_guard): Same.
(translate_clast): Same.
(gloog): Same.
* graphite-clast-to-gimple.h (debug_clast_name_indexes): Removed.
* graphite-sese-to-poly.c (scev_analyzable_p): Moved...
* sese.c (set_rename): Now static.
(rename_variables_in_stmt): Removed.
(rename_uses): New.
(is_parameter): Removed.
(is_iv): Removed.
(expand_scalar_variables_call): Removed.
(expand_scalar_variables_ssa_name): Removed.
(expand_scalar_variables_expr): Removed.
(expand_scalar_variables_stmt): Removed.
(expand_scalar_variables): Removed.
(rename_variables): Removed.
(remove_condition): Removed.
(get_true_edge_from_guard_bb): Removed.
(get_false_edge_from_guard_bb): Removed.
(struct igp): Removed.
(default_before_guard): Removed.
(convert_for_phi_arg): Removed.
(add_guard_exit_phis): Removed.
(insert_guard_phis): Removed.
(graphite_copy_stmts_from_block): Now also uses iv_map and a
region. Do not copy conditions. Do not copy induction variables.
Call rename_uses.
(copy_bb_and_scalar_dependences): Allocate a local rename_map for
the translated statement. Use the iv_map for the induction
variable renaming.
* sese.h (copy_bb_and_scalar_dependences): Update declaration.
(set_rename): Removed declaration.
(scev_analyzable_p): ...here.
* tree-chrec.c (chrec_apply_map): New.
* tree-chrec.h (chrec_apply_map): Declared.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162243 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 47 +++
gcc/ChangeLog.graphite | 47 +++
gcc/graphite-clast-to-gimple.c | 129 +++-----
gcc/graphite-clast-to-gimple.h | 1 -
gcc/graphite-sese-to-poly.c | 14 -
gcc/sese.c | 675 ++++++++--------------------------------
gcc/sese.h | 19 +-
gcc/tree-chrec.c | 17 +
gcc/tree-chrec.h | 1 +
9 files changed, 293 insertions(+), 657 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 301c7a3..ec0f773 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,52 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (debug_clast_name_index): Removed.
+ (debug_clast_name_indexes_1): Removed.
+ (debug_clast_name_indexes): Removed.
+ (pbb_to_depth_to_oldiv): Removed.
+ (build_iv_mapping): Replace the use of rename_map with iv_map.
+ (translate_clast_user): Remove uses of rename_map. Allocate and
+ free iv_map.
+ (translate_clast_for_loop): Remove uses of rename_map.
+ (translate_clast_for): Same.
+ (translate_clast_guard): Same.
+ (translate_clast): Same.
+ (gloog): Same.
+ * graphite-clast-to-gimple.h (debug_clast_name_indexes): Removed.
+ * graphite-sese-to-poly.c (scev_analyzable_p): Moved...
+ * sese.c (set_rename): Now static.
+ (rename_variables_in_stmt): Removed.
+ (rename_uses): New.
+ (is_parameter): Removed.
+ (is_iv): Removed.
+ (expand_scalar_variables_call): Removed.
+ (expand_scalar_variables_ssa_name): Removed.
+ (expand_scalar_variables_expr): Removed.
+ (expand_scalar_variables_stmt): Removed.
+ (expand_scalar_variables): Removed.
+ (rename_variables): Removed.
+ (remove_condition): Removed.
+ (get_true_edge_from_guard_bb): Removed.
+ (get_false_edge_from_guard_bb): Removed.
+ (struct igp): Removed.
+ (default_before_guard): Removed.
+ (convert_for_phi_arg): Removed.
+ (add_guard_exit_phis): Removed.
+ (insert_guard_phis): Removed.
+ (graphite_copy_stmts_from_block): Now also uses iv_map and a
+ region. Do not copy conditions. Do not copy induction variables.
+ Call rename_uses.
+ (copy_bb_and_scalar_dependences): Allocate a local rename_map for
+ the translated statement. Use the iv_map for the induction
+ variable renaming.
+ * sese.h (copy_bb_and_scalar_dependences): Update declaration.
+ (set_rename): Removed declaration.
+ (scev_analyzable_p): ...here.
+ * tree-chrec.c (chrec_apply_map): New.
+ * tree-chrec.h (chrec_apply_map): Declared.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (translate_clast_for_loop): Do not call
insert_loop_close_phis.
* sese.c (name_defined_in_loop_p): Removed.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 2cd80ee..3c7615b 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,52 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-clast-to-gimple.c (debug_clast_name_index): Removed.
+ (debug_clast_name_indexes_1): Removed.
+ (debug_clast_name_indexes): Removed.
+ (pbb_to_depth_to_oldiv): Removed.
+ (build_iv_mapping): Replace the use of rename_map with iv_map.
+ (translate_clast_user): Remove uses of rename_map. Allocate and
+ free iv_map.
+ (translate_clast_for_loop): Remove uses of rename_map.
+ (translate_clast_for): Same.
+ (translate_clast_guard): Same.
+ (translate_clast): Same.
+ (gloog): Same.
+ * graphite-clast-to-gimple.h (debug_clast_name_indexes): Removed.
+ * graphite-sese-to-poly.c (scev_analyzable_p): Moved...
+ * sese.c (set_rename): Now static.
+ (rename_variables_in_stmt): Removed.
+ (rename_uses): New.
+ (is_parameter): Removed.
+ (is_iv): Removed.
+ (expand_scalar_variables_call): Removed.
+ (expand_scalar_variables_ssa_name): Removed.
+ (expand_scalar_variables_expr): Removed.
+ (expand_scalar_variables_stmt): Removed.
+ (expand_scalar_variables): Removed.
+ (rename_variables): Removed.
+ (remove_condition): Removed.
+ (get_true_edge_from_guard_bb): Removed.
+ (get_false_edge_from_guard_bb): Removed.
+ (struct igp): Removed.
+ (default_before_guard): Removed.
+ (convert_for_phi_arg): Removed.
+ (add_guard_exit_phis): Removed.
+ (insert_guard_phis): Removed.
+ (graphite_copy_stmts_from_block): Now also uses iv_map and a
+ region. Do not copy conditions. Do not copy induction variables.
+ Call rename_uses.
+ (copy_bb_and_scalar_dependences): Allocate a local rename_map for
+ the translated statement. Use the iv_map for the induction
+ variable renaming.
+ * sese.h (copy_bb_and_scalar_dependences): Update declaration.
+ (set_rename): Removed declaration.
+ (scev_analyzable_p): ...here.
+ * tree-chrec.c (chrec_apply_map): New.
+ * tree-chrec.h (chrec_apply_map): Declared.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-clast-to-gimple.c (translate_clast_for_loop): Do not call
insert_loop_close_phis.
* sese.c (name_defined_in_loop_p): Removed.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 80d602f..90ea435 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -130,32 +130,6 @@ save_clast_name_index (htab_t index_table, const char *name, int index)
}
}
-/* Print to stderr the element ELT. */
-
-static inline void
-debug_clast_name_index (clast_name_index_p elt)
-{
- fprintf (stderr, "(index = %d, name = %s)\n", elt->index, elt->name);
-}
-
-/* Helper function for debug_rename_map. */
-
-static inline int
-debug_clast_name_indexes_1 (void **slot, void *s ATTRIBUTE_UNUSED)
-{
- struct clast_name_index *entry = (struct clast_name_index *) *slot;
- debug_clast_name_index (entry);
- return 1;
-}
-
-/* Print to stderr all the elements of MAP. */
-
-DEBUG_FUNCTION void
-debug_clast_name_indexes (htab_t map)
-{
- htab_traverse (map, debug_clast_name_indexes_1, NULL);
-}
-
/* Computes a hash function for database element ELT. */
static inline hashval_t
@@ -175,20 +149,6 @@ eq_clast_name_indexes (const void *e1, const void *e2)
return (elt1->name == elt2->name);
}
-
-/* For a given loop DEPTH in the loop nest of the original black box
- PBB, return the old induction variable associated to that loop. */
-
-static inline tree
-pbb_to_depth_to_oldiv (poly_bb_p pbb, int depth)
-{
- gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
- sese region = SCOP_REGION (PBB_SCOP (pbb));
- loop_p loop = gbb_loop_at_index (gbb, region, depth);
-
- return loop->single_iv;
-}
-
/* For a given scattering dimension, return the new induction variable
associated to it. */
@@ -820,34 +780,36 @@ graphite_create_new_loop (sese region, edge entry_edge,
return loop;
}
-/* Inserts in RENAME_MAP a tuple (OLD_NAME, NEW_NAME) for the induction
- variables of the loops around GBB in SESE. */
+/* Inserts in iv_map a tuple (OLD_LOOP->num, NEW_NAME) for the
+ induction variables of the loops around GBB in SESE. */
static void
-build_iv_mapping (htab_t rename_map, sese region,
+build_iv_mapping (VEC (tree, heap) *iv_map, sese region,
VEC (tree, heap) *newivs, htab_t newivs_index,
struct clast_user_stmt *user_stmt,
htab_t params_index)
{
struct clast_stmt *t;
- int index = 0;
+ int depth = 0;
CloogStatement *cs = user_stmt->statement;
poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (cs);
+ gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
- for (t = user_stmt->substitutions; t; t = t->next, index++)
+ for (t = user_stmt->substitutions; t; t = t->next, depth++)
{
struct clast_expr *expr = (struct clast_expr *)
((struct clast_assignment *)t)->RHS;
tree type = gcc_type_for_clast_expr (expr, region, newivs,
newivs_index, params_index);
- tree old_name = pbb_to_depth_to_oldiv (pbb, index);
- tree e = clast_to_gcc_expression (type, expr, region, newivs,
- newivs_index, params_index);
- set_rename (rename_map, old_name, e);
+ tree new_name = clast_to_gcc_expression (type, expr, region, newivs,
+ newivs_index, params_index);
+ loop_p old_loop = gbb_loop_at_index (gbb, region, depth);
+
+ VEC_replace (tree, iv_map, old_loop->num, new_name);
}
}
-/* Construct bb_pbb_def with BB and PBB. */
+/* Construct bb_pbb_def with BB and PBB. */
static bb_pbb_def *
new_bb_pbb_def (basic_block bb, poly_bb_p pbb)
@@ -930,38 +892,39 @@ dependency_in_loop_p (loop_p loop, htab_t bb_pbb_mapping, int level)
return false;
}
-static edge
-translate_clast (sese, loop_p, struct clast_stmt *, edge, htab_t,
- VEC (tree, heap) **, htab_t, htab_t, int, htab_t);
-
/* Translates a clast user statement STMT to gimple.
- REGION is the sese region we used to generate the scop.
- NEXT_E is the edge where new generated code should be attached.
- CONTEXT_LOOP is the loop in which the generated code will be placed
- - RENAME_MAP contains a set of tuples of new names associated to
- the original variables names.
- BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
- PARAMS_INDEX connects the cloog parameters with the gimple parameters in
the sese region. */
static edge
translate_clast_user (sese region, struct clast_user_stmt *stmt, edge next_e,
- htab_t rename_map, VEC (tree, heap) **newivs,
+ VEC (tree, heap) **newivs,
htab_t newivs_index, htab_t bb_pbb_mapping,
htab_t params_index)
{
- gimple_bb_p gbb;
+ int i, nb_loops;
basic_block new_bb;
poly_bb_p pbb = (poly_bb_p) cloog_statement_usr (stmt->statement);
- gbb = PBB_BLACK_BOX (pbb);
+ gimple_bb_p gbb = PBB_BLACK_BOX (pbb);
+ VEC (tree, heap) *iv_map;
if (GBB_BB (gbb) == ENTRY_BLOCK_PTR)
return next_e;
- build_iv_mapping (rename_map, region, *newivs, newivs_index, stmt,
- params_index);
+ nb_loops = number_of_loops ();
+ iv_map = VEC_alloc (tree, heap, nb_loops);
+ for (i = 0; i < nb_loops; i++)
+ VEC_quick_push (tree, iv_map, NULL_TREE);
+
+ build_iv_mapping (iv_map, region, *newivs, newivs_index, stmt, params_index);
next_e = copy_bb_and_scalar_dependences (GBB_BB (gbb), region,
- next_e, rename_map);
+ next_e, iv_map);
+ VEC_free (tree, heap, iv_map);
+
new_bb = next_e->src;
mark_bb_with_pbb (pbb, new_bb, bb_pbb_mapping);
update_ssa (TODO_update_ssa);
@@ -1009,20 +972,21 @@ graphite_create_new_loop_guard (sese region, edge entry_edge,
return exit_edge;
}
+static edge
+translate_clast (sese, loop_p, struct clast_stmt *, edge,
+ VEC (tree, heap) **, htab_t, htab_t, int, htab_t);
/* Create the loop for a clast for statement.
- REGION is the sese region we used to generate the scop.
- NEXT_E is the edge where new generated code should be attached.
- - RENAME_MAP contains a set of tuples of new names associated to
- the original variables names.
- BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
- PARAMS_INDEX connects the cloog parameters with the gimple parameters in
the sese region. */
static edge
translate_clast_for_loop (sese region, loop_p context_loop,
struct clast_for *stmt, edge next_e,
- htab_t rename_map, VEC (tree, heap) **newivs,
+ VEC (tree, heap) **newivs,
htab_t newivs_index, htab_t bb_pbb_mapping,
int level, htab_t params_index)
{
@@ -1038,7 +1002,7 @@ translate_clast_for_loop (sese region, loop_p context_loop,
last_e = single_succ_edge (split_edge (last_e));
/* Translate the body of the loop. */
- next_e = translate_clast (region, loop, stmt->body, to_body, rename_map,
+ next_e = translate_clast (region, loop, stmt->body, to_body,
newivs, newivs_index, bb_pbb_mapping, level + 1,
params_index);
redirect_edge_succ_nodup (next_e, after);
@@ -1058,14 +1022,12 @@ translate_clast_for_loop (sese region, loop_p context_loop,
- REGION is the sese region we used to generate the scop.
- NEXT_E is the edge where new generated code should be attached.
- - RENAME_MAP contains a set of tuples of new names associated to
- the original variables names.
- BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
- PARAMS_INDEX connects the cloog parameters with the gimple parameters in
the sese region. */
static edge
translate_clast_for (sese region, loop_p context_loop, struct clast_for *stmt,
- edge next_e, htab_t rename_map, VEC (tree, heap) **newivs,
+ edge next_e, VEC (tree, heap) **newivs,
htab_t newivs_index, htab_t bb_pbb_mapping, int level,
htab_t params_index)
{
@@ -1073,8 +1035,7 @@ translate_clast_for (sese region, loop_p context_loop, struct clast_for *stmt,
newivs_index, params_index);
edge true_e = get_true_edge_from_guard_bb (next_e->dest);
- translate_clast_for_loop (region, context_loop, stmt, true_e,
- rename_map, newivs,
+ translate_clast_for_loop (region, context_loop, stmt, true_e, newivs,
newivs_index, bb_pbb_mapping, level,
params_index);
return last_e;
@@ -1085,15 +1046,13 @@ translate_clast_for (sese region, loop_p context_loop, struct clast_for *stmt,
- REGION is the sese region we used to generate the scop.
- NEXT_E is the edge where new generated code should be attached.
- CONTEXT_LOOP is the loop in which the generated code will be placed
- - RENAME_MAP contains a set of tuples of new names associated to
- the original variables names.
- BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping.
- PARAMS_INDEX connects the cloog parameters with the gimple parameters in
the sese region. */
static edge
translate_clast_guard (sese region, loop_p context_loop,
struct clast_guard *stmt, edge next_e,
- htab_t rename_map, VEC (tree, heap) **newivs,
+ VEC (tree, heap) **newivs,
htab_t newivs_index, htab_t bb_pbb_mapping, int level,
htab_t params_index)
{
@@ -1102,7 +1061,7 @@ translate_clast_guard (sese region, loop_p context_loop,
edge true_e = get_true_edge_from_guard_bb (next_e->dest);
translate_clast (region, context_loop, stmt->then, true_e,
- rename_map, newivs, newivs_index, bb_pbb_mapping,
+ newivs, newivs_index, bb_pbb_mapping,
level, params_index);
return last_e;
}
@@ -1112,12 +1071,10 @@ translate_clast_guard (sese region, loop_p context_loop,
- NEXT_E is the edge where new generated code should be attached.
- CONTEXT_LOOP is the loop in which the generated code will be placed
- - RENAME_MAP contains a set of tuples of new names associated to
- the original variables names.
- BB_PBB_MAPPING is is a basic_block and it's related poly_bb_p mapping. */
static edge
translate_clast (sese region, loop_p context_loop, struct clast_stmt *stmt,
- edge next_e, htab_t rename_map, VEC (tree, heap) **newivs,
+ edge next_e, VEC (tree, heap) **newivs,
htab_t newivs_index, htab_t bb_pbb_mapping, int level,
htab_t params_index)
{
@@ -1129,25 +1086,25 @@ translate_clast (sese region, loop_p context_loop, struct clast_stmt *stmt,
else if (CLAST_STMT_IS_A (stmt, stmt_user))
next_e = translate_clast_user (region, (struct clast_user_stmt *) stmt,
- next_e, rename_map, newivs, newivs_index,
+ next_e, newivs, newivs_index,
bb_pbb_mapping, params_index);
else if (CLAST_STMT_IS_A (stmt, stmt_for))
next_e = translate_clast_for (region, context_loop,
(struct clast_for *) stmt, next_e,
- rename_map, newivs, newivs_index,
+ newivs, newivs_index,
bb_pbb_mapping, level, params_index);
else if (CLAST_STMT_IS_A (stmt, stmt_guard))
next_e = translate_clast_guard (region, context_loop,
(struct clast_guard *) stmt, next_e,
- rename_map, newivs, newivs_index,
+ newivs, newivs_index,
bb_pbb_mapping, level, params_index);
else if (CLAST_STMT_IS_A (stmt, stmt_block))
next_e = translate_clast (region, context_loop,
((struct clast_block *) stmt)->body,
- next_e, rename_map, newivs, newivs_index,
+ next_e, newivs, newivs_index,
bb_pbb_mapping, level, params_index);
else
gcc_unreachable();
@@ -1156,7 +1113,7 @@ translate_clast (sese region, loop_p context_loop, struct clast_stmt *stmt,
graphite_verify ();
return translate_clast (region, context_loop, stmt->next, next_e,
- rename_map, newivs, newivs_index,
+ newivs, newivs_index,
bb_pbb_mapping, level, params_index);
}
@@ -1483,7 +1440,7 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
loop_p context_loop;
sese region = SCOP_REGION (scop);
ifsese if_region = NULL;
- htab_t rename_map, newivs_index, params_index;
+ htab_t newivs_index, params_index;
cloog_prog_clast pc;
timevar_push (TV_GRAPHITE_CODE_GEN);
@@ -1510,7 +1467,6 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
graphite_verify ();
context_loop = SESE_ENTRY (region)->src->loop_father;
- rename_map = htab_create (10, rename_map_elt_info, eq_rename_map_elts, free);
newivs_index = htab_create (10, clast_name_index_elt_info,
eq_clast_name_indexes, free);
params_index = htab_create (10, clast_name_index_elt_info,
@@ -1520,7 +1476,7 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
translate_clast (region, context_loop, pc.stmt,
if_region->true_region->entry,
- rename_map, &newivs, newivs_index,
+ &newivs, newivs_index,
bb_pbb_mapping, 1, params_index);
graphite_verify ();
scev_reset_htab ();
@@ -1534,7 +1490,6 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
free (if_region->region);
free (if_region);
- htab_delete (rename_map);
htab_delete (newivs_index);
htab_delete (params_index);
VEC_free (tree, heap, newivs);
diff --git a/gcc/graphite-clast-to-gimple.h b/gcc/graphite-clast-to-gimple.h
index c90cfc0..fbb4efa 100644
--- a/gcc/graphite-clast-to-gimple.h
+++ b/gcc/graphite-clast-to-gimple.h
@@ -40,7 +40,6 @@ extern bool gloog (scop_p, htab_t);
extern cloog_prog_clast scop_to_clast (scop_p);
extern void debug_clast_stmt (struct clast_stmt *);
extern void print_clast_stmt (FILE *, struct clast_stmt *);
-extern void debug_clast_name_indexes (htab_t);
/* Hash function for data base element BB_PBB. */
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index ac251ab..b9bf284 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2333,20 +2333,6 @@ rewrite_reductions_out_of_ssa (scop_p scop)
#endif
}
-/* Return true when DEF can be analyzed in REGION by the scalar
- evolution analyzer. */
-
-static bool
-scev_analyzable_p (tree def, sese region)
-{
- gimple stmt = SSA_NAME_DEF_STMT (def);
- loop_p loop = loop_containing_stmt (stmt);
- tree scev = scalar_evolution_in_region (region, loop, def);
-
- return !chrec_contains_undetermined (scev)
- && TREE_CODE (scev) != SSA_NAME;
-}
-
/* Rewrite the scalar dependence of DEF used in USE_STMT with a memory
read from ZERO_DIM_ARRAY. */
diff --git a/gcc/sese.c b/gcc/sese.c
index 420776d..583504d 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -394,6 +394,38 @@ sese_insert_phis_for_liveouts (sese region, basic_block bb,
update_ssa (TODO_update_ssa);
}
+/* Returns the first successor edge of BB with EDGE_TRUE_VALUE flag set. */
+
+edge
+get_true_edge_from_guard_bb (basic_block bb)
+{
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->flags & EDGE_TRUE_VALUE)
+ return e;
+
+ gcc_unreachable ();
+ return NULL;
+}
+
+/* Returns the first successor edge of BB with EDGE_TRUE_VALUE flag cleared. */
+
+edge
+get_false_edge_from_guard_bb (basic_block bb)
+{
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (!(e->flags & EDGE_TRUE_VALUE))
+ return e;
+
+ gcc_unreachable ();
+ return NULL;
+}
+
/* Returns the expression associated to OLD_NAME in RENAME_MAP. */
static tree
@@ -409,12 +441,12 @@ get_rename (htab_t rename_map, tree old_name)
if (slot && *slot)
return ((rename_map_elt) *slot)->expr;
- return old_name;
+ return NULL_TREE;
}
/* Register in RENAME_MAP the rename tuple (OLD_NAME, EXPR). */
-void
+static void
set_rename (htab_t rename_map, tree old_name, tree expr)
{
struct rename_map_elt_s tmp;
@@ -435,579 +467,101 @@ set_rename (htab_t rename_map, tree old_name, tree expr)
*slot = new_rename_map_elt (old_name, expr);
}
-/* Rename the SSA_NAMEs used in STMT and that appear in RENAME_MAP. */
+/* Renames the scalar uses of the statement COPY, using the
+ substitution map RENAME_MAP, inserting the gimplification code at
+ GSI_TGT, for the translation REGION, with the original copied
+ statement in LOOP, and using the induction variable renaming map
+ IV_MAP. */
static void
-rename_variables_in_stmt (gimple stmt, htab_t rename_map, gimple_stmt_iterator *insert_gsi)
+rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt,
+ sese region, loop_p loop, VEC (tree, heap) *iv_map)
{
- ssa_op_iter iter;
use_operand_p use_p;
+ ssa_op_iter op_iter;
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
+ FOR_EACH_SSA_USE_OPERAND (use_p, copy, op_iter, SSA_OP_ALL_USES)
{
- tree use = USE_FROM_PTR (use_p);
- tree expr, type_use, type_expr;
+ tree old_name = USE_FROM_PTR (use_p);
+ tree new_expr, scev;
gimple_seq stmts;
- if (TREE_CODE (use) != SSA_NAME)
- continue;
-
- expr = get_rename (rename_map, use);
- if (use == expr)
+ if (TREE_CODE (old_name) != SSA_NAME
+ || !is_gimple_reg (old_name)
+ || SSA_NAME_IS_DEFAULT_DEF (old_name))
continue;
- type_use = TREE_TYPE (use);
- type_expr = TREE_TYPE (expr);
-
- if (type_use != type_expr
- || (TREE_CODE (expr) != SSA_NAME
- && is_gimple_reg (use)))
+ new_expr = get_rename (rename_map, old_name);
+ if (new_expr)
{
- tree var;
+ tree type_old_name = TREE_TYPE (old_name);
+ tree type_new_expr = TREE_TYPE (new_expr);
- if (is_gimple_debug (stmt))
+ if (type_old_name != type_new_expr
+ || (TREE_CODE (new_expr) != SSA_NAME
+ && is_gimple_reg (old_name)))
{
- if (gimple_debug_bind_p (stmt))
- gimple_debug_bind_reset_value (stmt);
- else
- gcc_unreachable ();
-
- break;
- }
-
- var = create_tmp_var (type_use, "var");
-
- if (type_use != type_expr)
- expr = fold_convert (type_use, expr);
-
- expr = build2 (MODIFY_EXPR, type_use, var, expr);
- expr = force_gimple_operand (expr, &stmts, true, NULL);
- gsi_insert_seq_before (insert_gsi, stmts, GSI_SAME_STMT);
- }
-
- replace_exp (use_p, expr);
- }
-
- update_stmt (stmt);
-}
-
-/* Returns true if NAME is a parameter of SESE. */
-
-static bool
-is_parameter (sese region, tree name)
-{
- int i;
- tree p;
-
- for (i = 0; VEC_iterate (tree, SESE_PARAMS (region), i, p); i++)
- if (p == name)
- return true;
-
- return false;
-}
-
-/* Returns true if NAME is an induction variable. */
-
-static bool
-is_iv (tree name)
-{
- return gimple_code (SSA_NAME_DEF_STMT (name)) == GIMPLE_PHI;
-}
-
-static void expand_scalar_variables_stmt (gimple, basic_block, sese,
- htab_t, gimple_stmt_iterator *);
-static tree
-expand_scalar_variables_expr (tree, tree, enum tree_code, tree, basic_block,
- sese, htab_t, gimple_stmt_iterator *);
-
-static tree
-expand_scalar_variables_call (gimple stmt, basic_block bb, sese region,
- htab_t rename_map, gimple_stmt_iterator *gsi)
-{
- int i, nargs = gimple_call_num_args (stmt);
- VEC (tree, gc) *args = VEC_alloc (tree, gc, nargs);
- tree fn_type = TREE_TYPE (gimple_call_fn (stmt));
- tree fn = gimple_call_fndecl (stmt);
- tree call_expr, var, lhs;
- gimple call;
-
- for (i = 0; i < nargs; i++)
- {
- tree arg = gimple_call_arg (stmt, i);
- tree t = TREE_TYPE (arg);
-
- var = create_tmp_var (t, "var");
- arg = expand_scalar_variables_expr (t, arg, TREE_CODE (arg), NULL,
- bb, region, rename_map, gsi);
- arg = build2 (MODIFY_EXPR, t, var, arg);
- arg = force_gimple_operand_gsi (gsi, arg, true, NULL,
- true, GSI_SAME_STMT);
- VEC_quick_push (tree, args, arg);
- }
-
- lhs = gimple_call_lhs (stmt);
- var = create_tmp_var (TREE_TYPE (lhs), "var");
- call_expr = build_call_vec (fn_type, fn, args);
- call = gimple_build_call_from_tree (call_expr);
- var = make_ssa_name (var, call);
- gimple_call_set_lhs (call, var);
- gsi_insert_before (gsi, call, GSI_SAME_STMT);
-
- return var;
-}
-
-/* Copies at GSI all the scalar computations on which the ssa_name OP0
- depends on in the SESE: these are all the scalar variables used in
- the definition of OP0, that are defined outside BB and still in the
- SESE, i.e. not a parameter of the SESE. The expression that is
- returned contains only induction variables from the generated code:
- RENAME_MAP contains the induction variables renaming mapping, and is used
- to translate the names of induction variables. */
-
-static tree
-expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
- sese region, htab_t rename_map,
- gimple_stmt_iterator *gsi)
-{
- gimple def_stmt;
- tree new_op;
-
- if (is_parameter (region, op0)
- || is_iv (op0))
- return fold_convert (type, get_rename (rename_map, op0));
-
- def_stmt = SSA_NAME_DEF_STMT (op0);
-
- /* Check whether we already have a rename for OP0. */
- new_op = get_rename (rename_map, op0);
-
- if (new_op != op0
- && gimple_bb (SSA_NAME_DEF_STMT (new_op)) == bb)
- return fold_convert (type, new_op);
-
- if (gimple_bb (def_stmt) == bb)
- {
- /* If the defining statement is in the basic block already
- we do not need to create a new expression for it, we
- only need to ensure its operands are expanded. */
- expand_scalar_variables_stmt (def_stmt, bb, region, rename_map, gsi);
- return fold_convert (type, new_op);
- }
- else
- {
- if (!gimple_bb (def_stmt)
- || !bb_in_sese_p (gimple_bb (def_stmt), region))
- return fold_convert (type, new_op);
-
- switch (gimple_code (def_stmt))
- {
- case GIMPLE_ASSIGN:
- {
- tree var0 = gimple_assign_rhs1 (def_stmt);
- enum tree_code subcode = gimple_assign_rhs_code (def_stmt);
- tree var1 = gimple_assign_rhs2 (def_stmt);
- tree type = gimple_expr_type (def_stmt);
-
- return expand_scalar_variables_expr (type, var0, subcode, var1, bb,
- region, rename_map, gsi);
- }
-
- case GIMPLE_CALL:
- return expand_scalar_variables_call (def_stmt, bb, region, rename_map, gsi);
-
- default:
- gcc_unreachable ();
- return new_op;
- }
- }
-}
-
-/* Copies at GSI all the scalar computations on which the expression
- OP0 CODE OP1 depends on in the SESE: these are all the scalar
- variables used in OP0 and OP1, defined outside BB and still defined
- in the SESE, i.e. not a parameter of the SESE. The expression that
- is returned contains only induction variables from the generated
- code: RENAME_MAP contains the induction variables renaming mapping, and is
- used to translate the names of induction variables. */
-
-static tree
-expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
- tree op1, basic_block bb, sese region,
- htab_t rename_map, gimple_stmt_iterator *gsi)
-{
- if (TREE_CODE_CLASS (code) == tcc_constant
- || TREE_CODE_CLASS (code) == tcc_declaration)
- return op0;
-
- /* For data references we have to duplicate also its memory
- indexing. */
- if (TREE_CODE_CLASS (code) == tcc_reference)
- {
- switch (code)
- {
- case REALPART_EXPR:
- case IMAGPART_EXPR:
- {
- tree op = TREE_OPERAND (op0, 0);
- tree res = expand_scalar_variables_expr
- (type, op, TREE_CODE (op), NULL, bb, region, rename_map, gsi);
- return build1 (code, type, res);
- }
-
- case INDIRECT_REF:
- {
- tree old_name = TREE_OPERAND (op0, 0);
- tree expr = expand_scalar_variables_ssa_name
- (type, old_name, bb, region, rename_map, gsi);
-
- if (TREE_CODE (expr) != SSA_NAME
- && is_gimple_reg (old_name))
- {
- tree type = TREE_TYPE (old_name);
- tree var = create_tmp_var (type, "var");
-
- expr = build2 (MODIFY_EXPR, type, var, expr);
- expr = force_gimple_operand_gsi (gsi, expr, true, NULL,
- true, GSI_SAME_STMT);
- }
-
- return fold_build1 (code, type, expr);
- }
-
- case ARRAY_REF:
- {
- tree op00 = TREE_OPERAND (op0, 0);
- tree op01 = TREE_OPERAND (op0, 1);
- tree op02 = TREE_OPERAND (op0, 2);
- tree op03 = TREE_OPERAND (op0, 3);
- tree base = expand_scalar_variables_expr
- (TREE_TYPE (op00), op00, TREE_CODE (op00), NULL, bb, region,
- rename_map, gsi);
- tree subscript = expand_scalar_variables_expr
- (TREE_TYPE (op01), op01, TREE_CODE (op01), NULL, bb, region,
- rename_map, gsi);
-
- return build4 (ARRAY_REF, type, base, subscript, op02, op03);
- }
-
- case COMPONENT_REF:
- return op0;
-
- default:
- /* The above cases should catch everything. */
- gcc_unreachable ();
- }
- }
-
- if (TREE_CODE_CLASS (code) == tcc_unary)
- {
- tree op0_type = TREE_TYPE (op0);
- enum tree_code op0_code = TREE_CODE (op0);
- tree op0_expr = expand_scalar_variables_expr (op0_type, op0, op0_code,
- NULL, bb, region, rename_map, gsi);
-
- return fold_build1 (code, type, op0_expr);
- }
-
- if (TREE_CODE_CLASS (code) == tcc_binary
- || TREE_CODE_CLASS (code) == tcc_comparison)
- {
- tree op0_type = TREE_TYPE (op0);
- enum tree_code op0_code = TREE_CODE (op0);
- tree op0_expr = expand_scalar_variables_expr (op0_type, op0, op0_code,
- NULL, bb, region, rename_map, gsi);
- tree op1_type = TREE_TYPE (op1);
- enum tree_code op1_code = TREE_CODE (op1);
- tree op1_expr = expand_scalar_variables_expr (op1_type, op1, op1_code,
- NULL, bb, region, rename_map, gsi);
-
- return fold_build2 (code, type, op0_expr, op1_expr);
- }
-
- if (code == SSA_NAME)
- return expand_scalar_variables_ssa_name (type, op0, bb, region, rename_map, gsi);
-
- if (code == ADDR_EXPR)
- {
- tree op00 = TREE_OPERAND (op0, 0);
-
- if (handled_component_p (op00)
- && TREE_CODE (op00) == ARRAY_REF)
- {
- tree e = expand_scalar_variables_expr (TREE_TYPE (op00), op00,
- TREE_CODE (op00),
- NULL, bb, region, rename_map, gsi);
- return fold_build1 (code, TREE_TYPE (op0), e);
- }
-
- return op0;
- }
-
- gcc_unreachable ();
- return NULL;
-}
-
-/* Copies at the beginning of BB all the scalar computations on which
- STMT depends on in the SESE: these are all the scalar variables used
- in STMT, defined outside BB and still defined in the SESE, i.e. not a
- parameter of the SESE. The expression that is returned contains
- only induction variables from the generated code: RENAME_MAP contains the
- induction variables renaming mapping, and is used to translate the
- names of induction variables. */
-
-static void
-expand_scalar_variables_stmt (gimple stmt, basic_block bb, sese region,
- htab_t rename_map, gimple_stmt_iterator *gsi)
-{
- ssa_op_iter iter;
- use_operand_p use_p;
-
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
- {
- tree use = USE_FROM_PTR (use_p);
- tree type = TREE_TYPE (use);
- enum tree_code code = TREE_CODE (use);
- tree use_expr;
-
- if (!is_gimple_reg (use))
- continue;
-
- /* Don't expand USE if we already have a rename for it. */
- use_expr = get_rename (rename_map, use);
- if (use_expr != use)
- continue;
+ tree var;
- use_expr = expand_scalar_variables_expr (type, use, code, NULL, bb,
- region, rename_map, gsi);
- use_expr = fold_convert (type, use_expr);
+ if (is_gimple_debug (copy))
+ {
+ if (gimple_debug_bind_p (copy))
+ gimple_debug_bind_reset_value (copy);
+ else
+ gcc_unreachable ();
- if (use_expr == use)
- continue;
+ break;
+ }
- if (is_gimple_debug (stmt))
- {
- if (gimple_debug_bind_p (stmt))
- gimple_debug_bind_reset_value (stmt);
- else
- gcc_unreachable ();
+ var = create_tmp_var (type_old_name, "var");
- break;
- }
+ if (type_old_name != type_new_expr)
+ new_expr = fold_convert (type_old_name, new_expr);
- if (TREE_CODE (use_expr) != SSA_NAME)
- {
- tree var = create_tmp_var (type, "var");
+ new_expr = build2 (MODIFY_EXPR, type_old_name, var, new_expr);
+ new_expr = force_gimple_operand (new_expr, &stmts, true, NULL);
+ gsi_insert_seq_before (gsi_tgt, stmts, GSI_SAME_STMT);
+ }
- use_expr = build2 (MODIFY_EXPR, type, var, use_expr);
- use_expr = force_gimple_operand_gsi (gsi, use_expr, true, NULL,
- true, GSI_SAME_STMT);
+ replace_exp (use_p, new_expr);
+ continue;
}
- replace_exp (use_p, use_expr);
- }
-
- update_stmt (stmt);
-}
-
-/* Copies at the beginning of BB all the scalar computations on which
- BB depends on in the SESE: these are all the scalar variables used
- in BB, defined outside BB and still defined in the SESE, i.e. not a
- parameter of the SESE. The expression that is returned contains
- only induction variables from the generated code: RENAME_MAP contains the
- induction variables renaming mapping, and is used to translate the
- names of induction variables. */
-
-static void
-expand_scalar_variables (basic_block bb, sese region, htab_t rename_map)
-{
- gimple_stmt_iterator gsi;
-
- for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi);)
- {
- gimple stmt = gsi_stmt (gsi);
- expand_scalar_variables_stmt (stmt, bb, region, rename_map, &gsi);
- gsi_next (&gsi);
- }
-}
-
-/* Rename all the SSA_NAMEs from block BB according to the RENAME_MAP. */
-
-static void
-rename_variables (basic_block bb, htab_t rename_map)
-{
- gimple_stmt_iterator gsi;
- gimple_stmt_iterator insert_gsi = gsi_start_bb (bb);
-
- for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- rename_variables_in_stmt (gsi_stmt (gsi), rename_map, &insert_gsi);
-}
-
-/* Remove condition from BB. */
-
-static void
-remove_condition (basic_block bb)
-{
- gimple last = last_stmt (bb);
-
- if (last && gimple_code (last) == GIMPLE_COND)
- {
- gimple_stmt_iterator gsi = gsi_last_bb (bb);
- gsi_remove (&gsi, true);
- }
-}
-
-/* Returns the first successor edge of BB with EDGE_TRUE_VALUE flag set. */
-
-edge
-get_true_edge_from_guard_bb (basic_block bb)
-{
- edge e;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, bb->succs)
- if (e->flags & EDGE_TRUE_VALUE)
- return e;
-
- gcc_unreachable ();
- return NULL;
-}
-
-/* Returns the first successor edge of BB with EDGE_TRUE_VALUE flag cleared. */
-
-edge
-get_false_edge_from_guard_bb (basic_block bb)
-{
- edge e;
- edge_iterator ei;
-
- FOR_EACH_EDGE (e, ei, bb->succs)
- if (!(e->flags & EDGE_TRUE_VALUE))
- return e;
-
- gcc_unreachable ();
- return NULL;
-}
-
-/* Helper structure for htab_traverse in insert_guard_phis. */
+ scev = scalar_evolution_in_region (region, loop, old_name);
-struct igp {
- basic_block bb;
- edge true_edge, false_edge;
- htab_t before_guard;
-};
+ /* At this point we should know the exact scev for each
+ scalar SSA_NAME used in the scop: all the other scalar
+ SSA_NAMEs should have been translated out of SSA using
+ arrays with one element. */
+ gcc_assert (!chrec_contains_undetermined (scev));
-/* Return the default name that is before the guard. */
+ new_expr = chrec_apply_map (scev, iv_map);
-static tree
-default_before_guard (htab_t before_guard, tree old_name)
-{
- tree res = get_rename (before_guard, old_name);
+ /* The apply should produce an expression tree containing
+ the uses of the new induction variables. We should be
+ able to use new_expr instead of the old_name in the newly
+ generated loop nest. */
+ gcc_assert (!chrec_contains_undetermined (new_expr)
+ && !tree_contains_chrecs (new_expr, NULL));
- if (res == old_name)
- {
- if (is_gimple_reg (res))
- return fold_convert (TREE_TYPE (res), integer_zero_node);
- return gimple_default_def (cfun, SSA_NAME_VAR (res));
+ /* Replace the old_name with the new_expr. */
+ new_expr = force_gimple_operand (new_expr, &stmts, true, NULL);
+ gsi_insert_seq_before (gsi_tgt, stmts, GSI_SAME_STMT);
+ replace_exp (use_p, new_expr);
+ set_rename (rename_map, old_name, new_expr);
}
-
- return res;
}
-/* Prepares EXPR to be a good phi argument when the phi result is
- RES. Insert needed statements on edge E. */
-
-static tree
-convert_for_phi_arg (tree expr, tree res, edge e)
-{
- tree type = TREE_TYPE (res);
-
- if (TREE_TYPE (expr) != type)
- expr = fold_convert (type, expr);
-
- if (TREE_CODE (expr) != SSA_NAME
- && !is_gimple_min_invariant (expr))
- {
- tree var = create_tmp_var (type, "var");
- gimple_seq stmts;
-
- expr = build2 (MODIFY_EXPR, type, var, expr);
- expr = force_gimple_operand (expr, &stmts, true, NULL);
- gsi_insert_seq_on_edge_immediate (e, stmts);
- }
-
- return expr;
-}
-
-/* Helper function for htab_traverse in insert_guard_phis. */
-
-static int
-add_guard_exit_phis (void **slot, void *s)
-{
- struct rename_map_elt_s *entry = (struct rename_map_elt_s *) *slot;
- struct igp *i = (struct igp *) s;
- basic_block bb = i->bb;
- edge true_edge = i->true_edge;
- edge false_edge = i->false_edge;
- tree res = entry->old_name;
- tree name1 = entry->expr;
- tree name2 = default_before_guard (i->before_guard, res);
- gimple phi;
-
- /* Nothing to be merged if the name before the guard is the same as
- the one after. */
- if (name1 == name2)
- return 1;
-
- name1 = convert_for_phi_arg (name1, res, true_edge);
- name2 = convert_for_phi_arg (name2, res, false_edge);
-
- phi = create_phi_node (res, bb);
- res = create_new_def_for (gimple_phi_result (phi), phi,
- gimple_phi_result_ptr (phi));
-
- add_phi_arg (phi, name1, true_edge, UNKNOWN_LOCATION);
- add_phi_arg (phi, name2, false_edge, UNKNOWN_LOCATION);
-
- entry->expr = res;
- *slot = entry;
- return 1;
-}
-
-/* Iterate over RENAME_MAP and get tuples of the form (OLD, NAME1).
- If there is a correspondent tuple (OLD, NAME2) in BEFORE_GUARD,
- with NAME1 different than NAME2, then insert in BB the phi node:
-
- | RES = phi (NAME1 (on TRUE_EDGE), NAME2 (on FALSE_EDGE))"
-
- if there is no tuple for OLD in BEFORE_GUARD, insert
-
- | RES = phi (NAME1 (on TRUE_EDGE),
- | DEFAULT_DEFINITION of NAME1 (on FALSE_EDGE))".
-
- Finally register in RENAME_MAP the tuple (OLD, RES). */
-
-void
-insert_guard_phis (basic_block bb, edge true_edge, edge false_edge,
- htab_t before_guard, htab_t rename_map)
-{
- struct igp i;
- i.bb = bb;
- i.true_edge = true_edge;
- i.false_edge = false_edge;
- i.before_guard = before_guard;
-
- update_ssa (TODO_update_ssa);
- htab_traverse (rename_map, add_guard_exit_phis, &i);
- update_ssa (TODO_update_ssa);
-}
-
-/* Create a duplicate of the basic block BB. NOTE: This does not
- preserve SSA form. */
+/* Duplicates the statements of basic block BB into basic block NEW_BB
+ and compute the new induction variables according to the IV_MAP. */
static void
-graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t rename_map)
+graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
+ htab_t rename_map,
+ VEC (tree, heap) *iv_map, sese region)
{
gimple_stmt_iterator gsi, gsi_tgt;
+ loop_p loop = bb->loop_father;
gsi_tgt = gsi_start_bb (new_bb);
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -1016,8 +570,19 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t renam
ssa_op_iter op_iter;
gimple stmt = gsi_stmt (gsi);
gimple copy;
+ tree lhs;
+
+ /* Do not copy labels or conditions. */
+ if (gimple_code (stmt) == GIMPLE_LABEL
+ || gimple_code (stmt) == GIMPLE_COND)
+ continue;
- if (gimple_code (stmt) == GIMPLE_LABEL)
+ /* Do not copy induction variables. */
+ if (is_gimple_assign (stmt)
+ && (lhs = gimple_assign_lhs (stmt))
+ && TREE_CODE (lhs) == SSA_NAME
+ && is_gimple_reg (lhs)
+ && scev_analyzable_p (lhs, region))
continue;
/* Create a new copy of STMT and duplicate STMT's virtual
@@ -1032,11 +597,15 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t renam
/* Create new names for all the definitions created by COPY and
add replacement mappings for each new name. */
FOR_EACH_SSA_DEF_OPERAND (def_p, copy, op_iter, SSA_OP_ALL_DEFS)
- {
- tree old_name = DEF_FROM_PTR (def_p);
- tree new_name = create_new_def_for (old_name, copy, def_p);
+ {
+ tree old_name = DEF_FROM_PTR (def_p);
+ tree new_name = create_new_def_for (old_name, copy, def_p);
set_rename (rename_map, old_name, new_name);
- }
+ }
+
+ rename_uses (copy, rename_map, &gsi_tgt, region, loop, iv_map);
+
+ update_stmt (copy);
}
}
@@ -1046,16 +615,16 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, htab_t renam
edge
copy_bb_and_scalar_dependences (basic_block bb, sese region,
- edge next_e, htab_t rename_map)
+ edge next_e, VEC (tree, heap) *iv_map)
{
basic_block new_bb = split_edge (next_e);
+ htab_t rename_map = htab_create (10, rename_map_elt_info,
+ eq_rename_map_elts, free);
next_e = single_succ_edge (new_bb);
- graphite_copy_stmts_from_block (bb, new_bb, rename_map);
- remove_condition (new_bb);
+ graphite_copy_stmts_from_block (bb, new_bb, rename_map, iv_map, region);
remove_phi_nodes (new_bb);
- expand_scalar_variables (new_bb, region, rename_map);
- rename_variables (new_bb, rename_map);
+ htab_delete (rename_map);
return next_e;
}
diff --git a/gcc/sese.h b/gcc/sese.h
index d0d829f..1502cbe 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -56,7 +56,8 @@ extern sese new_sese (edge, edge);
extern void free_sese (sese);
extern void sese_insert_phis_for_liveouts (sese, basic_block, edge, edge);
extern void build_sese_loop_nests (sese);
-extern edge copy_bb_and_scalar_dependences (basic_block, sese, edge, htab_t);
+extern edge copy_bb_and_scalar_dependences (basic_block, sese, edge,
+ VEC (tree, heap) *);
extern struct loop *outermost_loop_in_sese (sese, basic_block);
extern void insert_loop_close_phis (htab_t, loop_p);
extern void insert_guard_phis (basic_block, edge, edge, htab_t, htab_t);
@@ -261,7 +262,6 @@ DEF_VEC_ALLOC_P (rename_map_elt, heap);
extern void debug_rename_map (htab_t);
extern hashval_t rename_map_elt_info (const void *);
extern int eq_rename_map_elts (const void *, const void *);
-extern void set_rename (htab_t, tree, tree);
/* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW. */
@@ -386,4 +386,19 @@ nb_common_loops (sese region, gimple_bb_p gbb1, gimple_bb_p gbb2)
return sese_loop_depth (region, common);
}
+/* Return true when DEF can be analyzed in REGION by the scalar
+ evolution analyzer. */
+
+static inline bool
+scev_analyzable_p (tree def, sese region)
+{
+ gimple stmt = SSA_NAME_DEF_STMT (def);
+ loop_p loop = loop_containing_stmt (stmt);
+ tree scev = scalar_evolution_in_region (region, loop, def);
+
+ return !chrec_contains_undetermined (scev)
+ && TREE_CODE (scev) != SSA_NAME
+ && evolution_function_is_affine_p (scev);
+}
+
#endif
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 2d15285..c92b6b9 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -632,6 +632,23 @@ chrec_apply (unsigned var,
return res;
}
+/* For a given CHREC and an induction variable map IV_MAP that maps
+ (loop->num, expr) for every loop number of the current_loops an
+ expression, calls chrec_apply when the expression is not NULL. */
+
+tree
+chrec_apply_map (tree chrec, VEC (tree, heap) *iv_map)
+{
+ int i;
+ tree expr;
+
+ for (i = 0; VEC_iterate (tree, iv_map, i, expr); i++)
+ if (expr)
+ chrec = chrec_apply (i, chrec, expr);
+
+ return chrec;
+}
+
/* Replaces the initial condition in CHREC with INIT_COND. */
tree
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h
index fcff93a..eb60ac9 100644
--- a/gcc/tree-chrec.h
+++ b/gcc/tree-chrec.h
@@ -64,6 +64,7 @@ extern tree chrec_convert_aggressive (tree, tree);
/* Operations. */
extern tree chrec_apply (unsigned, tree, tree);
+extern tree chrec_apply_map (tree, VEC (tree, heap) *);
extern tree chrec_replace_initial_condition (tree, tree);
extern tree initial_condition (tree);
extern tree initial_condition_in_loop_num (tree, unsigned);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 29/65] Resolve CLooG's value_* macros to their respective mpz_* counterparts.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (43 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 48/65] Dot refined regions Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 46/65] Add testcase for PR20742 Sebastian Pop
` (22 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-04 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c
(precision_for_value): Resolve value_* calls to matching mpz_* calls.
(precision_for_interval): Same.
(gcc_type_for_interval): Same.
(compute_type_for_level): Same.
* graphite-interchange.c
(lst_interchange_profitable_p): Same.
* graphite-poly.c
(psct_scattering_dim_for_loop_depth): Same.
* graphite-ppl.c
(ppl_max_for_le_pointset): Same.
(ppl_min_for_le_pointset): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@161820 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 15 +++++++++++++
gcc/ChangeLog.graphite | 15 +++++++++++++
gcc/graphite-clast-to-gimple.c | 46 ++++++++++++++++++++--------------------
gcc/graphite-interchange.c | 2 +-
gcc/graphite-poly.c | 2 +-
gcc/graphite-ppl.c | 4 +-
6 files changed, 57 insertions(+), 27 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 397839b..672f765 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * graphite-clast-to-gimple.c
+ (precision_for_value): Resolve value_* calls to matching mpz_* calls.
+ (precision_for_interval): Same.
+ (gcc_type_for_interval): Same.
+ (compute_type_for_level): Same.
+ * graphite-interchange.c
+ (lst_interchange_profitable_p): Same.
+ * graphite-poly.c
+ (psct_scattering_dim_for_loop_depth): Same.
+ * graphite-ppl.c
+ (ppl_max_for_le_pointset): Same.
+ (ppl_min_for_le_pointset): Same.
+
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_degenerate_phi): New.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 34a83b6..a589860 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,18 @@
+2010-07-04 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * graphite-clast-to-gimple.c
+ (precision_for_value): Resolve value_* calls to matching mpz_* calls.
+ (precision_for_interval): Same.
+ (gcc_type_for_interval): Same.
+ (compute_type_for_level): Same.
+ * graphite-interchange.c
+ (lst_interchange_profitable_p): Same.
+ * graphite-poly.c
+ (psct_scattering_dim_for_loop_depth): Same.
+ * graphite-ppl.c
+ (ppl_max_for_le_pointset): Same.
+ (ppl_min_for_le_pointset): Same.
+
2010-06-25 Vladimir Kargov <kargov@gmail.com>
* refined-regions.c (bb_index_compare): New.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 7eb9165..aca2c31 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -426,26 +426,26 @@ precision_for_value (mpz_t val)
mpz_t x, y, two;
int precision;
- value_init (x);
- value_init (y);
- value_init (two);
- value_set_si (x, 2);
- value_assign (y, val);
- value_set_si (two, 2);
+ mpz_init (x);
+ mpz_init (y);
+ mpz_init (two);
+ mpz_set_si (x, 2);
+ mpz_set (y, val);
+ mpz_set_si (two, 2);
precision = 1;
- if (value_neg_p (y))
- value_oppose (y, y);
+ if (mpz_sgn (y) < 0)
+ mpz_neg (y, y);
- while (value_gt (y, x))
+ while (mpz_cmp (y, x) > 0)
{
- value_multiply (x, x, two);
+ mpz_mul (x, x, two);
precision++;
}
- value_clear (x);
- value_clear (y);
- value_clear (two);
+ mpz_clear (x);
+ mpz_clear (y);
+ mpz_clear (two);
return precision;
}
@@ -459,12 +459,12 @@ precision_for_interval (mpz_t low, mpz_t up)
mpz_t diff;
int precision;
- gcc_assert (value_le (low, up));
+ gcc_assert (mpz_cmp (low, up) <= 0);
- value_init (diff);
- value_subtract (diff, up, low);
+ mpz_init (diff);
+ mpz_sub (diff, up, low);
precision = precision_for_value (diff);
- value_clear (diff);
+ mpz_clear (diff);
return precision;
}
@@ -479,9 +479,9 @@ gcc_type_for_interval (mpz_t low, mpz_t up)
tree type;
enum machine_mode mode;
- gcc_assert (value_le (low, up));
+ gcc_assert (mpz_cmp (low, up) <= 0);
- if (value_neg_p (low))
+ if (mpz_sgn (low) < 0)
unsigned_p = false;
prec_up = precision_for_value (up);
@@ -731,14 +731,14 @@ compute_type_for_level (poly_bb_p pbb, int level)
mpz_t low, up;
tree type;
- value_init (low);
- value_init (up);
+ mpz_init (low);
+ mpz_init (up);
compute_bounds_for_level (pbb, level, low, up);
type = gcc_type_for_interval (low, up);
- value_clear (low);
- value_clear (up);
+ mpz_clear (low);
+ mpz_clear (up);
return type;
}
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c
index 0a7a749..de3bf25 100644
--- a/gcc/graphite-interchange.c
+++ b/gcc/graphite-interchange.c
@@ -478,7 +478,7 @@ lst_interchange_profitable_p (lst_p loop1, lst_p loop2)
memory_strides_in_loop (loop1, lst_depth (loop1), d1);
memory_strides_in_loop (loop2, lst_depth (loop2), d2);
- res = value_lt (d1, d2);
+ res = mpz_cmp (d1, d2) < 0;
mpz_clear (d1);
mpz_clear (d2);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 28da7f0..5c4a6f9 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -1032,7 +1032,7 @@ psct_scattering_dim_for_loop_depth (poly_bb_p pbb, graphite_dim_t loop_depth)
ppl_Linear_Expression_coefficient (expr, scatter, coef);
ppl_Coefficient_to_mpz_t (coef, val);
- if (value_notzero_p (val))
+ if (mpz_sgn (val) != 0)
{
mpz_clear (val);
ppl_delete_Linear_Expression (expr);
diff --git a/gcc/graphite-ppl.c b/gcc/graphite-ppl.c
index bbe2024..9f5bab0 100644
--- a/gcc/graphite-ppl.c
+++ b/gcc/graphite-ppl.c
@@ -664,7 +664,7 @@ ppl_max_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t ps,
{
ppl_Coefficient_to_mpz_t (num, nv);
ppl_Coefficient_to_mpz_t (denom, dv);
- gcc_assert (value_notzero_p (dv));
+ gcc_assert (mpz_sgn (dv) != 0);
mpz_tdiv_q (res, nv, dv);
}
@@ -695,7 +695,7 @@ ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t ps,
{
ppl_Coefficient_to_mpz_t (num, nv);
ppl_Coefficient_to_mpz_t (denom, dv);
- gcc_assert (value_notzero_p (dv));
+ gcc_assert (mpz_sgn (dv) != 0);
mpz_tdiv_q (res, nv, dv);
}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 51/65] Do not instantiate default definitions in instantiate_scev_name.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (37 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 34/65] Remove insert_loop_close_phis Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 52/65] Use SSA_NAME_DEF_STMT only on SSA_NAMEs Sebastian Pop
` (28 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
* tree-scalar-evolution.c (instantiate_scev_name): Do not
instantiate default definitions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162444 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 5 +++++
gcc/tree-scalar-evolution.c | 13 ++++++++-----
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7064ecc..ff88292 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
+ * tree-scalar-evolution.c (instantiate_scev_name): Do not
+ instantiate default definitions.
+
2010-08-02 Vladimir Kargov <kargov@gmail.com>
Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 699a8a6..155e396 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
+
+ * tree-scalar-evolution.c (instantiate_scev_name): Do not
+ instantiate default definitions.
+
2010-07-20 Vladimir Kargov <kargov@gmail.com>
* graphite-scop-detection.c (is_valid_stmt_p): New.
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 0e37256..edf8b3e 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -2179,11 +2179,15 @@ instantiate_scev_name (basic_block instantiate_below,
result again. */
res = analyze_scalar_evolution (def_loop, chrec);
- /* Don't instantiate loop-closed-ssa phi nodes. */
+ /* Don't instantiate default definitions. */
if (TREE_CODE (res) == SSA_NAME
- && (loop_containing_stmt (SSA_NAME_DEF_STMT (res)) == NULL
- || (loop_depth (loop_containing_stmt (SSA_NAME_DEF_STMT (res)))
- > loop_depth (def_loop))))
+ && SSA_NAME_IS_DEFAULT_DEF (res))
+ ;
+
+ /* Don't instantiate loop-closed-ssa phi nodes. */
+ else if (TREE_CODE (res) == SSA_NAME
+ && loop_depth (loop_containing_stmt (SSA_NAME_DEF_STMT (res)))
+ > loop_depth (def_loop))
{
if (res == chrec)
res = loop_closed_phi_def (chrec);
@@ -2213,7 +2217,6 @@ instantiate_scev_name (basic_block instantiate_below,
/* Store the correct value to the cache. */
set_instantiated_value (cache, instantiate_below, chrec, res);
return res;
-
}
/* Analyze all the parameters of the chrec, between INSTANTIATE_BELOW
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 47/65] Do not translate out-of-SSA close phi nodes that can be analyzed with scev.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (46 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 22/65] Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 55/65] Fix tonto: call propagate_expr_outside_region Sebastian Pop
` (19 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-20 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add an
extra parameter for the region. Call scev_analyzable_p.
(rewrite_reductions_out_of_ssa): Update call to
rewrite_close_phi_out_of_ssa.
(rewrite_cross_bb_phi_deps): Same.
(rewrite_commutative_reductions_out_of_ssa_loop): Add an extra
parameter for the region. Call scev_analyzable_p.
(rewrite_commutative_reductions_out_of_ssa): Update call to
rewrite_commutative_reductions_out_of_ssa_loop.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162351 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 12 ++++++++++++
gcc/ChangeLog.graphite | 12 ++++++++++++
gcc/graphite-sese-to-poly.c | 24 +++++++++++++++++-------
3 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 29efa29..1fa3f50 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,17 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add an
+ extra parameter for the region. Call scev_analyzable_p.
+ (rewrite_reductions_out_of_ssa): Update call to
+ rewrite_close_phi_out_of_ssa.
+ (rewrite_cross_bb_phi_deps): Same.
+ (rewrite_commutative_reductions_out_of_ssa_loop): Add an extra
+ parameter for the region. Call scev_analyzable_p.
+ (rewrite_commutative_reductions_out_of_ssa): Update call to
+ rewrite_commutative_reductions_out_of_ssa_loop.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* sese.c (rename_uses): Call unshare_expr before force_gimple_operand.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 5e36bc3..24c88d5 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,17 @@
2010-07-20 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add an
+ extra parameter for the region. Call scev_analyzable_p.
+ (rewrite_reductions_out_of_ssa): Update call to
+ rewrite_close_phi_out_of_ssa.
+ (rewrite_cross_bb_phi_deps): Same.
+ (rewrite_commutative_reductions_out_of_ssa_loop): Add an extra
+ parameter for the region. Call scev_analyzable_p.
+ (rewrite_commutative_reductions_out_of_ssa): Update call to
+ rewrite_commutative_reductions_out_of_ssa_loop.
+
+2010-07-20 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/tree-ssa/pr20742.c: New.
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 7244ba9..81b2dc2 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2186,7 +2186,7 @@ scalar_close_phi_node_p (gimple phi)
dimension array for it. */
static void
-rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
+rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi, sese region)
{
gimple phi = gsi_stmt (*psi);
tree res = gimple_phi_result (phi);
@@ -2201,6 +2201,14 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
before Graphite: see canonicalize_loop_closed_ssa_form. */
gcc_assert (gimple_phi_num_args (phi) == 1);
+ /* If res is scev analyzable, it is safe to ignore the close phi
+ node: it will be code generated in the out of Graphite pass. */
+ if (scev_analyzable_p (res, region))
+ {
+ gsi_next (psi);
+ return;
+ }
+
/* The phi node can be a non close phi node, when its argument is
invariant, or when it is defined in the same loop as the phi node. */
if (is_gimple_min_invariant (arg)
@@ -2321,7 +2329,7 @@ rewrite_reductions_out_of_ssa (scop_p scop)
rewrite_degenerate_phi (&psi);
else if (scalar_close_phi_node_p (phi))
- rewrite_close_phi_out_of_ssa (&psi);
+ rewrite_close_phi_out_of_ssa (&psi, region);
else if (reduction_phi_p (region, &psi))
rewrite_phi_out_of_ssa (&psi);
@@ -2386,7 +2394,7 @@ rewrite_cross_bb_phi_deps (sese region, gimple_stmt_iterator gsi)
gimple_stmt_iterator psi = gsi_for_stmt (use_stmt);
if (scalar_close_phi_node_p (gsi_stmt (psi)))
- rewrite_close_phi_out_of_ssa (&psi);
+ rewrite_close_phi_out_of_ssa (&psi, region);
else
rewrite_phi_out_of_ssa (&psi);
}
@@ -2871,7 +2879,8 @@ rewrite_commutative_reductions_out_of_ssa_close_phi (gimple close_phi,
static void
rewrite_commutative_reductions_out_of_ssa_loop (loop_p loop,
- sbitmap reductions)
+ sbitmap reductions,
+ sese region)
{
gimple_stmt_iterator gsi;
edge exit = single_exit (loop);
@@ -2880,8 +2889,9 @@ rewrite_commutative_reductions_out_of_ssa_loop (loop_p loop,
return;
for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi))
- rewrite_commutative_reductions_out_of_ssa_close_phi (gsi_stmt (gsi),
- reductions);
+ if (!scev_analyzable_p (gimple_phi_result (gsi_stmt (gsi)), region))
+ rewrite_commutative_reductions_out_of_ssa_close_phi (gsi_stmt (gsi),
+ reductions);
}
/* Rewrites all the commutative reductions from SCOP out of SSA. */
@@ -2897,7 +2907,7 @@ rewrite_commutative_reductions_out_of_ssa (sese region, sbitmap reductions)
FOR_EACH_LOOP (li, loop, 0)
if (loop_in_sese_p (loop, region))
- rewrite_commutative_reductions_out_of_ssa_loop (loop, reductions);
+ rewrite_commutative_reductions_out_of_ssa_loop (loop, reductions, region);
gsi_commit_edge_inserts ();
update_ssa (TODO_update_ssa);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 43/65] Correctly handle SSA_NAME_IS_DEFAULT_DEF in rewrite_close_phi_out_of_ssa.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (35 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 39/65] Bump the size of scevs Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 34/65] Remove insert_loop_close_phis Sebastian Pop
` (30 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly
handle SSA_NAME_IS_DEFAULT_DEF.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162251 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 5 +++++
gcc/graphite-sese-to-poly.c | 4 ++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 385cdac..0433d9b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly
+ handle SSA_NAME_IS_DEFAULT_DEF.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* sese.c (rename_uses): Handl unconditionally gimple_debug statements.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 37bedfb..27cacc0 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly
+ handle SSA_NAME_IS_DEFAULT_DEF.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* sese.c (rename_uses): Handl unconditionally gimple_debug statements.
* gcc.dg/graphite/pr42729.c: New.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index bea9c9f..0420285 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2216,6 +2216,7 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
/* The phi node can be a non close phi node, when its argument is
invariant, or when it is defined in the same loop as the phi node. */
if (is_gimple_min_invariant (arg)
+ || SSA_NAME_IS_DEFAULT_DEF (arg)
|| gimple_bb (SSA_NAME_DEF_STMT (arg))->loop_father == bb->loop_father)
stmt = gimple_build_assign (res, arg);
else
@@ -2224,8 +2225,7 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
stmt = gimple_build_assign (res, zero_dim_array);
- if (TREE_CODE (arg) == SSA_NAME
- && !SSA_NAME_IS_DEFAULT_DEF (arg))
+ if (TREE_CODE (arg) == SSA_NAME)
insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
else
insert_out_of_ssa_copy_on_edge (single_pred_edge (bb),
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 49/65] Add loop_exits_from_bb_p.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (40 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 44/65] Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 35/65] Remove expand_scalar_variables_ hack Sebastian Pop
` (25 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-20 Vladimir Kargov <kargov@gmail.com>
Sebastian Pop <sebastian.pop@amd.com>
* cfgloop.c (is_loop_exit): Renamed loop_exits_to_bb_p.
(loop_exits_from_bb_p): New.
* cfgloop.h (is_loop_exit): Renamed loop_exits_to_bb_p.
(loop_exits_from_bb_p): Declared.
* graphite-scop-detection.c (scopdet_basic_block_info): Call
loop_exits_to_bb_p.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162353 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 10 ++++++++++
gcc/ChangeLog.graphite | 10 ++++++++++
gcc/cfgloop.c | 19 +++++++++++++++++--
gcc/cfgloop.h | 3 ++-
gcc/graphite-scop-detection.c | 2 +-
5 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1fa3f50..7064ecc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-02 Vladimir Kargov <kargov@gmail.com>
+ Sebastian Pop <sebastian.pop@amd.com>
+
+ * cfgloop.c (is_loop_exit): Renamed loop_exits_to_bb_p.
+ (loop_exits_from_bb_p): New.
+ * cfgloop.h (is_loop_exit): Renamed loop_exits_to_bb_p.
+ (loop_exits_from_bb_p): Declared.
+ * graphite-scop-detection.c (scopdet_basic_block_info): Call
+ loop_exits_to_bb_p.
+
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add an
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index e4d59ce..96034ad 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,14 @@
2010-07-20 Vladimir Kargov <kargov@gmail.com>
+ Sebastian Pop <sebastian.pop@amd.com>
+
+ * cfgloop.c (is_loop_exit): Renamed loop_exits_to_bb_p.
+ (loop_exits_from_bb_p): New.
+ * cfgloop.h (is_loop_exit): Renamed loop_exits_to_bb_p.
+ (loop_exits_from_bb_p): Declared.
+ * graphite-scop-detection.c (scopdet_basic_block_info): Call
+ loop_exits_to_bb_p.
+
+2010-07-20 Vladimir Kargov <kargov@gmail.com>
* refined-regions.c: Include tree-pass.h, cfgloop.h, gimple.h, and
tree-data-ref.h.
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 24f0ebc..d114563 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -1620,10 +1620,10 @@ single_exit (const struct loop *loop)
return NULL;
}
-/* Returns true when BB has an edge exiting LOOP. */
+/* Returns true when BB has an incoming edge exiting LOOP. */
bool
-is_loop_exit (struct loop *loop, basic_block bb)
+loop_exits_to_bb_p (struct loop *loop, basic_block bb)
{
edge e;
edge_iterator ei;
@@ -1634,3 +1634,18 @@ is_loop_exit (struct loop *loop, basic_block bb)
return false;
}
+
+/* Returns true when BB has an outgoing edge exiting LOOP. */
+
+bool
+loop_exits_from_bb_p (struct loop *loop, basic_block bb)
+{
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (loop_exit_edge_p (loop, e))
+ return true;
+
+ return false;
+}
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 1f0e3ca..722aa33 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -232,7 +232,8 @@ extern int num_loop_insns (const struct loop *);
extern int average_num_loop_insns (const struct loop *);
extern unsigned get_loop_level (const struct loop *);
extern bool loop_exit_edge_p (const struct loop *, const_edge);
-extern bool is_loop_exit (struct loop *, basic_block);
+extern bool loop_exits_to_bb_p (struct loop *, basic_block);
+extern bool loop_exits_from_bb_p (struct loop *, basic_block);
extern void mark_loop_exit_edges (void);
/* Loops & cfg manipulation. */
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index baa4c34..07d94d0 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -594,7 +594,7 @@ scopdet_basic_block_info (basic_block bb, loop_p outermost_loop,
{
/* Ignore loop exits. They will be handled after the loop
body. */
- if (is_loop_exit (loop, e->dest))
+ if (loop_exits_to_bb_p (loop, e->dest))
{
result.exits = true;
continue;
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 39/65] Bump the size of scevs.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (34 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 36/65] chrec_apply should only apply to the specified variable Sebastian Pop
@ 2010-08-02 20:24 ` Sebastian Pop
2010-08-02 20:24 ` [PATCH 43/65] Correctly handle SSA_NAME_IS_DEFAULT_DEF in rewrite_close_phi_out_of_ssa Sebastian Pop
` (31 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162247 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 4 ++++
gcc/ChangeLog.graphite | 4 ++++
gcc/params.def | 2 +-
3 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 69a2dc1..d6c67ad 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
* cfgloop.h (struct loop): Remove single_iv field.
* graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 07b48a3..9eb3ae8 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,9 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* cfgloop.c (alloc_loop): Remove initialization of loop->single_iv.
* cfgloop.h (struct loop): Remove single_iv field.
* graphite-sese-to-poly.c (graphite_loop_normal_form): Removed.
diff --git a/gcc/params.def b/gcc/params.def
index 1d4e687..44c728f 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -467,7 +467,7 @@ DEFPARAM(PARAM_IV_ALWAYS_PRUNE_CAND_SET_BOUND,
DEFPARAM(PARAM_SCEV_MAX_EXPR_SIZE,
"scev-max-expr-size",
"Bound on size of expressions used in the scalar evolutions analyzer",
- 20, 0, 0)
+ 100, 0, 0)
DEFPARAM(PARAM_OMEGA_MAX_VARS,
"omega-max-vars",
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 56/65] Call scev_reset_htab when Graphite out-of-SSA has changed something.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (60 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 63/65] Fix typos Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 50/65] Enhance region checks Sebastian Pop
` (5 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-27 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Returns
a bool.
(rewrite_commutative_reductions_out_of_ssa_close_phi): Same.
(rewrite_commutative_reductions_out_of_ssa_loop): Same.
(rewrite_cross_bb_scalar_deps_out_of_ssa): Call scev_reset_htab
when something has been changed.
(rewrite_commutative_reductions_out_of_ssa): Same.
* gcc.dg/graphite/id-26.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162599 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 10 ++++
gcc/ChangeLog.graphite | 12 +++++
gcc/graphite-sese-to-poly.c | 75 ++++++++++++++++++++++----------
gcc/testsuite/ChangeLog | 4 ++
gcc/testsuite/gcc.dg/graphite/id-26.c | 24 ++++++++++
5 files changed, 101 insertions(+), 24 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-26.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 976ccf2..559a2f8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Returns
+ a bool.
+ (rewrite_commutative_reductions_out_of_ssa_close_phi): Same.
+ (rewrite_commutative_reductions_out_of_ssa_loop): Same.
+ (rewrite_cross_bb_scalar_deps_out_of_ssa): Call scev_reset_htab
+ when something has been changed.
+ (rewrite_commutative_reductions_out_of_ssa): Same.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (propagate_expr_outside_region): Also
handle the case when def is in the sese region.
(rewrite_close_phi_out_of_ssa): Call propagate_expr_outside_region
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index cf0bd6b..bcdd3a9 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,15 @@
+2010-07-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Returns
+ a bool.
+ (rewrite_commutative_reductions_out_of_ssa_close_phi): Same.
+ (rewrite_commutative_reductions_out_of_ssa_loop): Same.
+ (rewrite_cross_bb_scalar_deps_out_of_ssa): Call scev_reset_htab
+ when something has been changed.
+ (rewrite_commutative_reductions_out_of_ssa): Same.
+
+ * gcc.dg/graphite/id-26.c: New.
+
2010-07-26 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (propagate_expr_outside_region): Also
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index f92c97e..44c6588 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2428,9 +2428,10 @@ rewrite_cross_bb_scalar_dependence (tree zero_dim_array, tree def, gimple use_st
}
/* Rewrite the scalar dependences crossing the boundary of the BB
- containing STMT with an array. */
+ containing STMT with an array. Return true when something has been
+ changed. */
-static void
+static bool
rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
{
gimple stmt = gsi_stmt (*gsi);
@@ -2439,6 +2440,7 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
basic_block def_bb;
tree zero_dim_array = NULL_TREE;
gimple use_stmt;
+ bool res = false;
switch (gimple_code (stmt))
{
@@ -2451,27 +2453,29 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
break;
default:
- return;
+ return false;
}
if (!is_gimple_reg (def))
- return;
+ return false;
if (scev_analyzable_p (def, region))
{
loop_p loop = loop_containing_stmt (SSA_NAME_DEF_STMT (def));
tree scev = scalar_evolution_in_region (region, loop, def);
- if (tree_does_not_contain_chrecs (scev))
- propagate_expr_outside_region (def, scev, region);
+ if (tree_contains_chrecs (scev, NULL))
+ return false;
- return;
+ propagate_expr_outside_region (def, scev, region);
+ return true;
}
def_bb = gimple_bb (stmt);
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
- if (gimple_code (use_stmt) == GIMPLE_PHI)
+ if (gimple_code (use_stmt) == GIMPLE_PHI
+ && (res = true))
{
gimple_stmt_iterator psi = gsi_for_stmt (use_stmt);
@@ -2484,7 +2488,8 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
if (gimple_code (use_stmt) != GIMPLE_PHI
&& def_bb != gimple_bb (use_stmt)
- && !is_gimple_debug (use_stmt))
+ && !is_gimple_debug (use_stmt)
+ && (res = true))
{
if (!zero_dim_array)
{
@@ -2497,6 +2502,8 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
rewrite_cross_bb_scalar_dependence (zero_dim_array, def, use_stmt);
}
+
+ return res;
}
/* Rewrite out of SSA all the reduction phi nodes of SCOP. */
@@ -2507,16 +2514,21 @@ rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p scop)
basic_block bb;
gimple_stmt_iterator psi;
sese region = SCOP_REGION (scop);
+ bool changed = false;
FOR_EACH_BB (bb)
if (bb_in_sese_p (bb, region))
for (psi = gsi_start_bb (bb); !gsi_end_p (psi); gsi_next (&psi))
- rewrite_cross_bb_scalar_deps (region, &psi);
+ changed |= rewrite_cross_bb_scalar_deps (region, &psi);
- update_ssa (TODO_update_ssa);
+ if (changed)
+ {
+ scev_reset_htab ();
+ update_ssa (TODO_update_ssa);
#ifdef ENABLE_CHECKING
- verify_loop_closed_ssa (true);
+ verify_loop_closed_ssa (true);
#endif
+ }
}
/* Returns the number of pbbs that are in loops contained in SCOP. */
@@ -2902,26 +2914,31 @@ translate_scalar_reduction_to_array (VEC (gimple, heap) *in,
}
}
-/* Rewrites out of SSA a commutative reduction at CLOSE_PHI. */
+/* Rewrites out of SSA a commutative reduction at CLOSE_PHI. Returns
+ true when something has been changed. */
-static void
+static bool
rewrite_commutative_reductions_out_of_ssa_close_phi (gimple close_phi,
sbitmap reductions)
{
+ bool res;
VEC (gimple, heap) *in = VEC_alloc (gimple, heap, 10);
VEC (gimple, heap) *out = VEC_alloc (gimple, heap, 10);
detect_commutative_reduction (close_phi, &in, &out);
- if (VEC_length (gimple, in) > 0)
+ res = VEC_length (gimple, in) > 0;
+ if (res)
translate_scalar_reduction_to_array (in, out, reductions);
VEC_free (gimple, heap, in);
VEC_free (gimple, heap, out);
+ return res;
}
-/* Rewrites all the commutative reductions from LOOP out of SSA. */
+/* Rewrites all the commutative reductions from LOOP out of SSA.
+ Returns true when something has been changed. */
-static void
+static bool
rewrite_commutative_reductions_out_of_ssa_loop (loop_p loop,
sbitmap reductions,
sese region)
@@ -2929,16 +2946,19 @@ rewrite_commutative_reductions_out_of_ssa_loop (loop_p loop,
gimple_stmt_iterator gsi;
edge exit = single_exit (loop);
tree res;
+ bool changed = false;
if (!exit)
- return;
+ return false;
for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi))
if ((res = gimple_phi_result (gsi_stmt (gsi)))
&& is_gimple_reg (res)
&& !scev_analyzable_p (res, region))
- rewrite_commutative_reductions_out_of_ssa_close_phi (gsi_stmt (gsi),
- reductions);
+ changed |= rewrite_commutative_reductions_out_of_ssa_close_phi
+ (gsi_stmt (gsi), reductions);
+
+ return changed;
}
/* Rewrites all the commutative reductions from SCOP out of SSA. */
@@ -2948,19 +2968,26 @@ rewrite_commutative_reductions_out_of_ssa (sese region, sbitmap reductions)
{
loop_iterator li;
loop_p loop;
+ bool changed = false;
if (!flag_associative_math)
return;
FOR_EACH_LOOP (li, loop, 0)
if (loop_in_sese_p (loop, region))
- rewrite_commutative_reductions_out_of_ssa_loop (loop, reductions, region);
+ changed |= rewrite_commutative_reductions_out_of_ssa_loop (loop,
+ reductions,
+ region);
- gsi_commit_edge_inserts ();
- update_ssa (TODO_update_ssa);
+ if (changed)
+ {
+ scev_reset_htab ();
+ gsi_commit_edge_inserts ();
+ update_ssa (TODO_update_ssa);
#ifdef ENABLE_CHECKING
- verify_loop_closed_ssa (true);
+ verify_loop_closed_ssa (true);
#endif
+ }
}
/* Java does not initialize long_long_integer_type_node. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9197cb2..c5d01bf 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/id-26.c: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/id-25.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/id-26.c b/gcc/testsuite/gcc.dg/graphite/id-26.c
new file mode 100644
index 0000000..507d159
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-26.c
@@ -0,0 +1,24 @@
+int find_sad_16x16(int *intra_mode)
+{
+ int current_intra_sad_2,best_intra_sad2;
+ int M1[16][16],M0[4][4][4][4],M3[4],M4[4][4];
+ int i,j,k;
+ int ii,jj;
+ int up_avail, left_avail, left_up_avail;
+ for (i=0;i<17;i++)
+ if (left_up_avail)
+ {
+ for (jj=0;jj<4;jj++)
+ for (ii=0;ii<4;ii++)
+ for (j=0;j<4;j++)
+ for (i=0;i<4;i++)
+ {
+ M0[i][ii][2][jj]=M3[0]-M3[1];
+ M0[i][ii][1][jj]=M3[2]+M3[3];
+ current_intra_sad_2 += abs(M0[i][ii][j][jj]);
+ }
+
+ if(current_intra_sad_2 < best_intra_sad2)
+ best_intra_sad2=current_intra_sad_2;
+ }
+}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 58/65] Make CLooG options compatible to newer CLooG releases and pass options to build_cloog_prog (CLOOG_ORG).
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (57 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 53/65] Propagate constant values or parametric expressions outside the scop region Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 54/65] Call scev_analyzable_p only on is_gimple_reg Sebastian Pop
` (8 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options
compatible to newer CLooG releases (CLOOG_ORG).
(build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG).
(scop_to_clast): Pass CloogOptions to build_cloog_prog (CLOOG_ORG).
* graphite-cloog-compat.h: Add compatibility macros for CLooG Legacy.
(build_cloog_prog) : New.
(cloog_program_extract_scalars): New.
(cloog_program_scatter): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162605 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 11 +++++++++++
gcc/ChangeLog.graphite | 11 +++++++++++
gcc/graphite-clast-to-gimple.c | 13 +++++++++----
gcc/graphite-cloog-compat.h | 12 ++++++++++++
4 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0583fd6..273f743 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options
+ compatible to newer CLooG releases (CLOOG_ORG).
+ (build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG).
+ (scop_to_clast): Pass CloogOptions to build_cloog_prog (CLOOG_ORG).
+ * graphite-cloog-compat.h: Add compatibility macros for CLooG Legacy.
+ (build_cloog_prog) : New.
+ (cloog_program_extract_scalars): New.
+ (cloog_program_scatter): New.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c: Include graphite-cloog-compat.h
conditionally (CLOOG_ORG).
* graphite-cloog-compat.h: New. Include graphite-cloog-compat.h.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index cfc3c7a..6361c49 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,16 @@
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options
+ compatible to newer CLooG releases (CLOOG_ORG).
+ (build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG).
+ (scop_to_clast): Pass CloogOptions to build_cloog_prog (CLOOG_ORG).
+ * graphite-cloog-compat.h: Add compatibility macros for CLooG Legacy.
+ (build_cloog_prog) : New.
+ (cloog_program_extract_scalars): New.
+ (cloog_program_scatter): New.
+
+2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c: Include graphite-cloog-compat.h
conditionally (CLOOG_ORG).
* graphite-cloog-compat.h: New. Include graphite-cloog-compat.h.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 89a182c..a611ca7 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1198,7 +1198,7 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
/* Build cloog program for SCoP. */
static void
-build_cloog_prog (scop_p scop, CloogProgram *prog)
+build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
{
int i;
int max_nb_loops = scop_max_loop_depth (scop);
@@ -1277,10 +1277,10 @@ build_cloog_prog (scop_p scop, CloogProgram *prog)
cloog_program_set_scaldims (prog, scaldims);
/* Extract scalar dimensions to simplify the code generation problem. */
- cloog_program_extract_scalars (prog, scattering);
+ cloog_program_extract_scalars (prog, scattering, options);
/* Apply scattering. */
- cloog_program_scatter (prog, scattering);
+ cloog_program_scatter (prog, scattering, options);
free_scattering (scattering);
/* Iterators corresponding to scalar dimensions have to be extracted. */
@@ -1321,9 +1321,14 @@ set_cloog_options (void)
GLooG. */
options->esp = 1;
+#ifdef CLOOG_ORG
+ /* Silence CLooG to avoid failing tests due to debug output to stderr. */
+ options->quiet = 1;
+#else
/* Enable C pretty-printing mode: normalizes the substitution
equations for statements. */
options->cpp = 1;
+#endif
/* Allow cloog to build strides with a stride width different to one.
This example has stride = 4:
@@ -1378,7 +1383,7 @@ scop_to_clast (scop_p scop)
/* Connect new cloog prog generation to graphite. */
pc.prog = cloog_program_malloc ();
- build_cloog_prog (scop, pc.prog);
+ build_cloog_prog (scop, pc.prog, options);
pc.prog = cloog_program_generate (pc.prog, options);
pc.stmt = cloog_clast_create (pc.prog, options);
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index 44f7157..6608318 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -22,6 +22,18 @@ along with GCC; see the file COPYING3. If not see
#ifndef GRAPHITE_CLOOG_COMPAT_H
#define GRAPHITE_CLOOG_COMPAT_H
+/* Restore compatibility to CLooG Legacy. */
+#ifndef CLOOG_ORG
+
+/* CloogOptions compatibility. */
+#define build_cloog_prog(SCOP, PROG, OPT) build_cloog_prog (SCOP, PROG)
+#define cloog_program_extract_scalars(PROG, SCATT, OPT)\
+ cloog_program_extract_scalars (PROG, SCATT)
+#define cloog_program_scatter(PROG, SCATT, OPT)\
+ cloog_program_scatter (PROG, SCATT)
+
+#endif
+
/* Adapt CLooG accessors from CLooG legacy to
newer CLooG versions. */
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 55/65] Fix tonto: call propagate_expr_outside_region.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (47 preceding siblings ...)
2010-08-02 20:24 ` [PATCH 47/65] Do not translate out-of-SSA close phi nodes that can be analyzed with scev Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-10-26 19:37 ` H.J. Lu
2010-08-02 20:25 ` [PATCH 59/65] Adapt to new CLAST structure within upstream CLooG version and retain compatibility to CLooG Legacy Sebastian Pop
` (18 subsequent siblings)
67 siblings, 1 reply; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-26 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (propagate_expr_outside_region): Also
handle the case when def is in the sese region.
(rewrite_close_phi_out_of_ssa): Call propagate_expr_outside_region
for invariant expressions.
(rewrite_cross_bb_phi_deps): Removed.
(rewrite_cross_bb_scalar_deps): Also handle GIMPLE_PHI nodes.
(rewrite_cross_bb_scalar_deps_out_of_ssa): Do not call
rewrite_cross_bb_phi_deps.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162556 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 11 +++++++
gcc/ChangeLog.graphite | 11 +++++++
gcc/graphite-sese-to-poly.c | 64 ++++++++++++++-----------------------------
3 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0f07a8b..976ccf2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (propagate_expr_outside_region): Also
+ handle the case when def is in the sese region.
+ (rewrite_close_phi_out_of_ssa): Call propagate_expr_outside_region
+ for invariant expressions.
+ (rewrite_cross_bb_phi_deps): Removed.
+ (rewrite_cross_bb_scalar_deps): Also handle GIMPLE_PHI nodes.
+ (rewrite_cross_bb_scalar_deps_out_of_ssa): Do not call
+ rewrite_cross_bb_phi_deps.2
+
+010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c
(rewrite_commutative_reductions_out_of_ssa_loop): Call
scev_analyzable_p only on is_gimple_reg
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 65607ec..cf0bd6b 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,16 @@
2010-07-26 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (propagate_expr_outside_region): Also
+ handle the case when def is in the sese region.
+ (rewrite_close_phi_out_of_ssa): Call propagate_expr_outside_region
+ for invariant expressions.
+ (rewrite_cross_bb_phi_deps): Removed.
+ (rewrite_cross_bb_scalar_deps): Also handle GIMPLE_PHI nodes.
+ (rewrite_cross_bb_scalar_deps_out_of_ssa): Do not call
+ rewrite_cross_bb_phi_deps.
+
+2010-07-26 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c
(rewrite_commutative_reductions_out_of_ssa_loop): Call
scev_analyzable_p only on is_gimple_reg
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index ae8518f..f92c97e 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2193,8 +2193,7 @@ propagate_expr_outside_region (tree def, tree expr, sese region)
gimple_seq stmts;
bool replaced_once = false;
- gcc_assert (TREE_CODE (def) == SSA_NAME
- && bb_in_sese_p (gimple_bb (SSA_NAME_DEF_STMT (def)), region));
+ gcc_assert (TREE_CODE (def) == SSA_NAME);
expr = force_gimple_operand (unshare_expr (expr), &stmts, true,
NULL_TREE);
@@ -2245,7 +2244,11 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi, sese region)
if (is_gimple_min_invariant (arg)
|| SSA_NAME_IS_DEFAULT_DEF (arg)
|| gimple_bb (SSA_NAME_DEF_STMT (arg))->loop_father == bb->loop_father)
- stmt = gimple_build_assign (res, arg);
+ {
+ propagate_expr_outside_region (res, arg, region);
+ gsi_next (psi);
+ return;
+ }
/* If res is scev analyzable and is not a scalar value, it is safe
to ignore the close phi node: it will be code generated in the
@@ -2262,7 +2265,7 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi, sese region)
scev = compute_overall_effect_of_inner_loop (loop, scev);
}
else
- scev = scalar_evolution_in_region (region, loop, res);
+ scev = scalar_evolution_in_region (region, loop, res);
if (tree_does_not_contain_chrecs (scev))
propagate_expr_outside_region (res, scev, region);
@@ -2425,38 +2428,6 @@ rewrite_cross_bb_scalar_dependence (tree zero_dim_array, tree def, gimple use_st
}
/* Rewrite the scalar dependences crossing the boundary of the BB
- containing STMT with an array. GSI points to a definition that is
- used in a PHI node. */
-
-static void
-rewrite_cross_bb_phi_deps (sese region, gimple_stmt_iterator gsi)
-{
- gimple stmt = gsi_stmt (gsi);
- imm_use_iterator imm_iter;
- tree def;
- gimple use_stmt;
-
- if (gimple_code (stmt) != GIMPLE_ASSIGN)
- return;
-
- def = gimple_assign_lhs (stmt);
- if (!is_gimple_reg (def)
- || scev_analyzable_p (def, region))
- return;
-
- FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
- if (gimple_code (use_stmt) == GIMPLE_PHI)
- {
- gimple_stmt_iterator psi = gsi_for_stmt (use_stmt);
-
- if (scalar_close_phi_node_p (gsi_stmt (psi)))
- rewrite_close_phi_out_of_ssa (&psi, region);
- else
- rewrite_phi_out_of_ssa (&psi);
- }
-}
-
-/* Rewrite the scalar dependences crossing the boundary of the BB
containing STMT with an array. */
static void
@@ -2500,11 +2471,21 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
def_bb = gimple_bb (stmt);
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
- if (def_bb != gimple_bb (use_stmt)
- && !is_gimple_debug (use_stmt))
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
{
- gcc_assert (gimple_code (use_stmt) != GIMPLE_PHI);
+ gimple_stmt_iterator psi = gsi_for_stmt (use_stmt);
+ if (scalar_close_phi_node_p (gsi_stmt (psi)))
+ rewrite_close_phi_out_of_ssa (&psi, region);
+ else
+ rewrite_phi_out_of_ssa (&psi);
+ }
+
+ FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
+ if (gimple_code (use_stmt) != GIMPLE_PHI
+ && def_bb != gimple_bb (use_stmt)
+ && !is_gimple_debug (use_stmt))
+ {
if (!zero_dim_array)
{
zero_dim_array = create_zero_dim_array
@@ -2530,10 +2511,7 @@ rewrite_cross_bb_scalar_deps_out_of_ssa (scop_p scop)
FOR_EACH_BB (bb)
if (bb_in_sese_p (bb, region))
for (psi = gsi_start_bb (bb); !gsi_end_p (psi); gsi_next (&psi))
- {
- rewrite_cross_bb_phi_deps (region, psi);
- rewrite_cross_bb_scalar_deps (region, &psi);
- }
+ rewrite_cross_bb_scalar_deps (region, &psi);
update_ssa (TODO_update_ssa);
#ifdef ENABLE_CHECKING
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 65/65] Fix miscompile of 416.gamess.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (63 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 41/65] Special case non close-phi nodes with one argument in rewrite_close_phi_out_of_ssa Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-03 2:52 ` [PATCH 00/65] Merge from the Graphite branch to trunk Jack Howarth
` (2 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-29 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back
the case removed in the previous patch, when the only phi argument
is defined in the same loop as the phi node itself. Handle it
separately from the invariant case by both propagating it outside
the region and replacing the phi node with an assign.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162693 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 8 ++++++++
gcc/ChangeLog.graphite | 8 ++++++++
gcc/graphite-sese-to-poly.c | 10 ++++++++++
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3e01871..e58ccb7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back
+ the case removed in the previous patch, when the only phi argument
+ is defined in the same loop as the phi node itself. Handle it
+ separately from the invariant case by both propagating it outside
+ the region and replacing the phi node with an assign.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only
constant phi nodes with one argument are is_gimple_min_invariant
and SSA_NAME_IS_DEFAULT_DEF.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 1d3e64d..e43d2ce 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-07-29 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Add back
+ the case removed in the previous patch, when the only phi argument
+ is defined in the same loop as the phi node itself. Handle it
+ separately from the invariant case by both propagating it outside
+ the region and replacing the phi node with an assign.
+
2010-07-28 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 38e408c..4b94bcb 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2249,6 +2249,16 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi, sese region)
return;
}
+ else if (gimple_bb (SSA_NAME_DEF_STMT (arg))->loop_father == bb->loop_father)
+ {
+ propagate_expr_outside_region (res, arg, region);
+ stmt = gimple_build_assign (res, arg);
+ remove_phi_node (psi, false);
+ gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
+ SSA_NAME_DEF_STMT (res) = stmt;
+ return;
+ }
+
/* If res is scev analyzable and is not a scalar value, it is safe
to ignore the close phi node: it will be code generated in the
out of Graphite pass. */
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 59/65] Adapt to new CLAST structure within upstream CLooG version and retain compatibility to CLooG Legacy.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (48 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 55/65] Fix tonto: call propagate_expr_outside_region Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 64/65] Fix gamess: the only constant phi nodes with one argument are is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF Sebastian Pop
` (17 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter
type of NAME now depends on used CLooG version.
(clast_to_gcc_expression): Replace expr_* with clast_expr_*.
(gcc_type_for_clast_expr): Same.
(print_clast_stmt): Replace pprint with clast_pprint.
* graphite-cloog-compat.h: Provide compatibility macros for
CLooG Legacy.
(clast_name_p): New.
(clast_expr_term): New.
(clast_expr_red): New.
(clast_expr_bin): New.
(clast_pprint): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162606 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 15 +++++++++++++++
gcc/ChangeLog.graphite | 15 +++++++++++++++
gcc/graphite-clast-to-gimple.c | 28 +++++++++++++++++-----------
gcc/graphite-cloog-compat.h | 12 ++++++++++++
4 files changed, 59 insertions(+), 11 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 273f743..c830a22 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,20 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter
+ type of NAME now depends on used CLooG version.
+ (clast_to_gcc_expression): Replace expr_* with clast_expr_*.
+ (gcc_type_for_clast_expr): Same.
+ (print_clast_stmt): Replace pprint with clast_pprint.
+ * graphite-cloog-compat.h: Provide compatibility macros for
+ CLooG Legacy.
+ (clast_name_p): New.
+ (clast_expr_term): New.
+ (clast_expr_red): New.
+ (clast_expr_bin): New.
+ (clast_pprint): New.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options
compatible to newer CLooG releases (CLOOG_ORG).
(build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG).
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 6361c49..7e12177 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,20 @@
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter
+ type of NAME now depends on used CLooG version.
+ (clast_to_gcc_expression): Replace expr_* with clast_expr_*.
+ (gcc_type_for_clast_expr): Same.
+ (print_clast_stmt): Replace pprint with clast_pprint.
+ * graphite-cloog-compat.h: Provide compatibility macros for
+ CLooG Legacy.
+ (clast_name_p): New.
+ (clast_expr_term): New.
+ (clast_expr_red): New.
+ (clast_expr_bin): New.
+ (clast_pprint): New.
+
+2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options
compatible to newer CLooG releases (CLOOG_ORG).
(build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG).
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index a611ca7..29c8ffb 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -97,12 +97,18 @@ new_clast_name_index (const char *name, int index)
SCATTERING_DIMENSIONS vector. */
static inline int
-clast_name_to_index (const char *name, htab_t index_table)
+clast_name_to_index (clast_name_p name, htab_t index_table)
{
struct clast_name_index tmp;
PTR *slot;
+#ifdef CLOOG_ORG
+ gcc_assert (name->type == clast_expr_name);
+ tmp.name = ((const struct clast_name*) name)->name;
+#else
tmp.name = name;
+#endif
+
slot = htab_find_slot (index_table, &tmp, NO_INSERT);
if (slot && *slot)
@@ -165,7 +171,7 @@ newivs_to_depth_to_newiv (VEC (tree, heap) *newivs, int depth)
Cloog representation. */
static tree
-clast_name_to_gcc (const char *name, sese region, VEC (tree, heap) *newivs,
+clast_name_to_gcc (clast_name_p name, sese region, VEC (tree, heap) *newivs,
htab_t newivs_index, htab_t params_index)
{
int index;
@@ -267,7 +273,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
{
switch (e->type)
{
- case expr_term:
+ case clast_expr_term:
{
struct clast_term *t = (struct clast_term *) e;
@@ -319,7 +325,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
return gmp_cst_to_tree (type, t->val);
}
- case expr_red:
+ case clast_expr_red:
{
struct clast_reduction *r = (struct clast_reduction *) e;
@@ -346,7 +352,7 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
break;
}
- case expr_bin:
+ case clast_expr_bin:
{
struct clast_binary *b = (struct clast_binary *) e;
struct clast_expr *lhs = (struct clast_expr *) b->LHS;
@@ -485,7 +491,7 @@ gcc_type_for_clast_term (struct clast_term *t,
sese region, VEC (tree, heap) *newivs,
htab_t newivs_index, htab_t params_index)
{
- gcc_assert (t->expr.type == expr_term);
+ gcc_assert (t->expr.type == clast_expr_term);
if (!t->var)
return gcc_type_for_value (t->val);
@@ -557,15 +563,15 @@ gcc_type_for_clast_expr (struct clast_expr *e,
{
switch (e->type)
{
- case expr_term:
+ case clast_expr_term:
return gcc_type_for_clast_term ((struct clast_term *) e, region,
newivs, newivs_index, params_index);
- case expr_red:
+ case clast_expr_red:
return gcc_type_for_clast_red ((struct clast_reduction *) e, region,
newivs, newivs_index, params_index);
- case expr_bin:
+ case clast_expr_bin:
return gcc_type_for_clast_bin ((struct clast_binary *) e, region,
newivs, newivs_index, params_index);
@@ -1359,7 +1365,7 @@ print_clast_stmt (FILE *file, struct clast_stmt *stmt)
{
CloogOptions *options = set_cloog_options ();
- pprint (file, stmt, 0, options);
+ clast_pprint (file, stmt, 0, options);
cloog_options_free (options);
}
@@ -1404,7 +1410,7 @@ print_generated_program (FILE *file, scop_p scop)
fprintf (file, " )\n");
fprintf (file, " (clast: \n");
- pprint (file, pc.stmt, 0, options);
+ clast_pprint (file, pc.stmt, 0, options);
fprintf (file, " )\n");
cloog_options_free (options);
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index 6608318..8ff0e43 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -23,6 +23,12 @@ along with GCC; see the file COPYING3. If not see
#define GRAPHITE_CLOOG_COMPAT_H
/* Restore compatibility to CLooG Legacy. */
+#ifdef CLOOG_ORG
+typedef const struct clast_expr *clast_name_p;
+#else
+typedef const char *clast_name_p;
+#endif
+
#ifndef CLOOG_ORG
/* CloogOptions compatibility. */
@@ -32,6 +38,12 @@ along with GCC; see the file COPYING3. If not see
#define cloog_program_scatter(PROG, SCATT, OPT)\
cloog_program_scatter (PROG, SCATT)
+/* CLAST compatibility. */
+#define clast_expr_term expr_term
+#define clast_expr_red expr_red
+#define clast_expr_bin expr_bin
+#define clast_pprint pprint
+
#endif
/* Adapt CLooG accessors from CLooG legacy to
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 42/65] Add testcase for PR42729 and fix handling of gimple_debug info.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (54 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 45/65] Unshare the scev before code generating it Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 57/65] Reintroduce necessary CLooG accessors to graphite. Masked by CLOOG_ORG Sebastian Pop
` (11 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* sese.c (rename_uses): Handl unconditionally gimple_debug statements.
* gcc.dg/graphite/pr42729.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162250 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 4 ++++
gcc/ChangeLog.graphite | 6 ++++++
gcc/sese.c | 24 +++++++++++-------------
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gcc.dg/graphite/pr42729.c | 15 +++++++++++++++
5 files changed, 40 insertions(+), 13 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42729.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 07ee095..385cdac 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * sese.c (rename_uses): Handl unconditionally gimple_debug statements.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Special
case non close-phi nodes with one argument.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 965ed25..37bedfb 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,11 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * sese.c (rename_uses): Handl unconditionally gimple_debug statements.
+
+ * gcc.dg/graphite/pr42729.c: New.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Special
case non close-phi nodes with one argument.
diff --git a/gcc/sese.c b/gcc/sese.c
index 583504d..9dbd76f 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -480,6 +480,16 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt,
use_operand_p use_p;
ssa_op_iter op_iter;
+ if (is_gimple_debug (copy))
+ {
+ if (gimple_debug_bind_p (copy))
+ gimple_debug_bind_reset_value (copy);
+ else
+ gcc_unreachable ();
+
+ return;
+ }
+
FOR_EACH_SSA_USE_OPERAND (use_p, copy, op_iter, SSA_OP_ALL_USES)
{
tree old_name = USE_FROM_PTR (use_p);
@@ -501,19 +511,7 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt,
|| (TREE_CODE (new_expr) != SSA_NAME
&& is_gimple_reg (old_name)))
{
- tree var;
-
- if (is_gimple_debug (copy))
- {
- if (gimple_debug_bind_p (copy))
- gimple_debug_bind_reset_value (copy);
- else
- gcc_unreachable ();
-
- break;
- }
-
- var = create_tmp_var (type_old_name, "var");
+ tree var = create_tmp_var (type_old_name, "var");
if (type_old_name != type_new_expr)
new_expr = fold_convert (type_old_name, new_expr);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 172aaa3..76288ae 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/pr42729.c: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gfortran.dg/graphite/id-20.f: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42729.c b/gcc/testsuite/gcc.dg/graphite/pr42729.c
new file mode 100644
index 0000000..3a0e901
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr42729.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fgraphite-identity -fcompare-debug" } */
+
+int A[10];
+int *foo ()
+{
+ int *p1, *p2, i;
+ for (i = 0; i < 10; i++)
+ {
+ p1 = &A[i];
+ *p1 = 0;
+ }
+ p2 = p1;
+ return p2;
+}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 60/65] Introduce compatibility to newer CLooG's CloogState and mask the use with macros where possible.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (51 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 61/65] Adapt to new CloogScattering abstraction, introduced in official CLooG versions (CLOOG_ORG) Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 62/65] Remove cloog_initialize and cloog_finalize when using official CLooG releases Sebastian Pop
` (14 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c (build_cloog_prog): Extend with
CloogState.
(set_cloog_options): Same.
(print_clast_stmt): Same.
(scop_to_clast): Same.
(print_generated_program): Same.
(gloog): Same.
* graphite-clast-to-gimple.h: Include graphite-cloog-util.h.
(scop_to_clast): Extend with CloogState.
* graphite-cloog-util.c: Include graphite-cloog-compat.h
(new_Cloog_Domain_from_ppl_Polyhedron):
Extend with CloogState. Use cloog_domain_from_cloog_matrix (CLOOG_ORG).
(new_Cloog_Domain_from_ppl_Pointset_Powerset): Extend with CloogState.
(new_Cloog_Domain_from_ppl_Polyhedron): Same.
* graphite-cloog-util.h (build_cloog_prog): Same.
* graphite-cloog-copat.h (build_cloog_prog): New.
(CloogState): New.
(cloog_state_malloc): New.
(cloog_state_free): New.
(cloog_loop_malloc): New.
(cloog_options_malloc): New.
(cloog_statement_alloc): New.
(cloog_domain_from_cloog_matrix): New.
(new_Cloog_Domain_from_ppl_Pointset_Powerset): New.
(new_Cloog_Domain_from_ppl_Polyhedron): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162607 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 28 +++++++++++++++++++++++
gcc/ChangeLog.graphite | 28 +++++++++++++++++++++++
gcc/graphite-clast-to-gimple.c | 48 +++++++++++++++++++++++++---------------
gcc/graphite-clast-to-gimple.h | 3 +-
gcc/graphite-cloog-compat.h | 16 ++++++++++++-
gcc/graphite-cloog-util.c | 13 ++++++----
gcc/graphite-cloog-util.h | 7 +++--
7 files changed, 115 insertions(+), 28 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c830a22..2391126 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,33 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (build_cloog_prog): Extend with
+ CloogState.
+ (set_cloog_options): Same.
+ (print_clast_stmt): Same.
+ (scop_to_clast): Same.
+ (print_generated_program): Same.
+ (gloog): Same.
+ * graphite-clast-to-gimple.h: Include graphite-cloog-util.h.
+ (scop_to_clast): Extend with CloogState.
+ * graphite-cloog-util.c: Include graphite-cloog-compat.h
+ (new_Cloog_Domain_from_ppl_Polyhedron):
+ Extend with CloogState. Use cloog_domain_from_cloog_matrix (CLOOG_ORG).
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Extend with CloogState.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ * graphite-cloog-util.h (build_cloog_prog): Same.
+ * graphite-cloog-copat.h (build_cloog_prog): New.
+ (CloogState): New.
+ (cloog_state_malloc): New.
+ (cloog_state_free): New.
+ (cloog_loop_malloc): New.
+ (cloog_options_malloc): New.
+ (cloog_statement_alloc): New.
+ (cloog_domain_from_cloog_matrix): New.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): New.
+ (new_Cloog_Domain_from_ppl_Polyhedron): New.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter
type of NAME now depends on used CLooG version.
(clast_to_gcc_expression): Replace expr_* with clast_expr_*.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 7e12177..b5e53b5 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,33 @@
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (build_cloog_prog): Extend with
+ CloogState.
+ (set_cloog_options): Same.
+ (print_clast_stmt): Same.
+ (scop_to_clast): Same.
+ (print_generated_program): Same.
+ (gloog): Same.
+ * graphite-clast-to-gimple.h: Include graphite-cloog-util.h.
+ (scop_to_clast): Extend with CloogState.
+ * graphite-cloog-util.c: Include graphite-cloog-compat.h
+ (new_Cloog_Domain_from_ppl_Polyhedron):
+ Extend with CloogState. Use cloog_domain_from_cloog_matrix (CLOOG_ORG).
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): Extend with CloogState.
+ (new_Cloog_Domain_from_ppl_Polyhedron): Same.
+ * graphite-cloog-util.h (build_cloog_prog): Same.
+ * graphite-cloog-copat.h (build_cloog_prog): New.
+ (CloogState): New.
+ (cloog_state_malloc): New.
+ (cloog_state_free): New.
+ (cloog_loop_malloc): New.
+ (cloog_options_malloc): New.
+ (cloog_statement_alloc): New.
+ (cloog_domain_from_cloog_matrix): New.
+ (new_Cloog_Domain_from_ppl_Pointset_Powerset): New.
+ (new_Cloog_Domain_from_ppl_Polyhedron): New.
+
+2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (clast_name_to_gcc): Parameter
type of NAME now depends on used CLooG version.
(clast_to_gcc_expression): Replace expr_* with clast_expr_*.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 29c8ffb..11867cf 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1204,7 +1204,8 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
/* Build cloog program for SCoP. */
static void
-build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
+build_cloog_prog (scop_p scop, CloogProgram *prog,
+ CloogOptions *options, CloogState *state ATTRIBUTE_UNUSED)
{
int i;
int max_nb_loops = scop_max_loop_depth (scop);
@@ -1216,7 +1217,8 @@ build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
int *scaldims;
cloog_program_set_context
- (prog, new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop)));
+ (prog, new_Cloog_Domain_from_ppl_Pointset_Powerset (SCOP_CONTEXT (scop),
+ scop_nb_params (scop), state));
nbs = unify_scattering_dimensions (scop);
scaldims = (int *) xmalloc (nbs * (sizeof (int)));
cloog_program_set_nb_scattdims (prog, nbs);
@@ -1226,6 +1228,7 @@ build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
{
CloogStatement *stmt;
CloogBlock *block;
+ CloogDomain *dom;
/* Dead code elimination: when the domain of a PBB is empty,
don't generate code for the PBB. */
@@ -1233,17 +1236,18 @@ build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
continue;
/* Build the new statement and its block. */
- stmt = cloog_statement_alloc (pbb_index (pbb));
+ stmt = cloog_statement_alloc (state, pbb_index (pbb));
+ dom = new_Cloog_Domain_from_ppl_Pointset_Powerset (PBB_DOMAIN (pbb),
+ scop_nb_params (scop),
+ state);
block = cloog_block_alloc (stmt, 0, NULL, pbb_dim_iter_domain (pbb));
cloog_statement_set_usr (stmt, pbb);
/* Build loop list. */
{
- CloogLoop *new_loop_list = cloog_loop_malloc ();
+ CloogLoop *new_loop_list = cloog_loop_malloc (state);
cloog_loop_set_next (new_loop_list, loop_list);
- cloog_loop_set_domain
- (new_loop_list,
- new_Cloog_Domain_from_ppl_Pointset_Powerset (PBB_DOMAIN (pbb)));
+ cloog_loop_set_domain (new_loop_list, dom);
cloog_loop_set_block (new_loop_list, block);
loop_list = new_loop_list;
}
@@ -1266,7 +1270,8 @@ build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
CloogDomain *dom;
scat = PBB_TRANSFORMED_SCATTERING (pbb);
- dom = new_Cloog_Domain_from_ppl_Polyhedron (scat);
+ dom = new_Cloog_Domain_from_ppl_Polyhedron (scat, scop_nb_params (scop),
+ state);
cloog_set_next_domain (new_scattering, scattering);
cloog_set_domain (new_scattering, dom);
@@ -1312,9 +1317,9 @@ build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
/* Return the options that will be used in GLOOG. */
static CloogOptions *
-set_cloog_options (void)
+set_cloog_options (CloogState *state ATTRIBUTE_UNUSED)
{
- CloogOptions *options = cloog_options_malloc ();
+ CloogOptions *options = cloog_options_malloc (state);
/* Change cloog output language to C. If we do use FORTRAN instead, cloog
will stop e.g. with "ERROR: unbounded loops not allowed in FORTRAN.", if
@@ -1363,10 +1368,12 @@ set_cloog_options (void)
void
print_clast_stmt (FILE *file, struct clast_stmt *stmt)
{
- CloogOptions *options = set_cloog_options ();
+ CloogState *state = cloog_state_malloc ();
+ CloogOptions *options = set_cloog_options (state);
clast_pprint (file, stmt, 0, options);
cloog_options_free (options);
+ cloog_state_free (state);
}
/* Prints STMT to STDERR. */
@@ -1382,14 +1389,14 @@ debug_clast_stmt (struct clast_stmt *stmt)
without a program. */
cloog_prog_clast
-scop_to_clast (scop_p scop)
+scop_to_clast (scop_p scop, CloogState *state)
{
- CloogOptions *options = set_cloog_options ();
+ CloogOptions *options = set_cloog_options (state);
cloog_prog_clast pc;
/* Connect new cloog prog generation to graphite. */
pc.prog = cloog_program_malloc ();
- build_cloog_prog (scop, pc.prog, options);
+ build_cloog_prog (scop, pc.prog, options, state);
pc.prog = cloog_program_generate (pc.prog, options);
pc.stmt = cloog_clast_create (pc.prog, options);
@@ -1402,8 +1409,10 @@ scop_to_clast (scop_p scop)
void
print_generated_program (FILE *file, scop_p scop)
{
- CloogOptions *options = set_cloog_options ();
- cloog_prog_clast pc = scop_to_clast (scop);
+ CloogState *state = cloog_state_malloc ();
+ CloogOptions *options = set_cloog_options (state);
+
+ cloog_prog_clast pc = scop_to_clast (scop, state);
fprintf (file, " (prog: \n");
cloog_program_print (file, pc.prog);
@@ -1454,11 +1463,13 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
ifsese if_region = NULL;
htab_t newivs_index, params_index;
cloog_prog_clast pc;
+ CloogState *state;
+ state = cloog_state_malloc ();
timevar_push (TV_GRAPHITE_CODE_GEN);
gloog_error = false;
- pc = scop_to_clast (scop);
+ pc = scop_to_clast (scop, state);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -1523,7 +1534,8 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
num_no_dependency);
}
+ cloog_state_free (state);
+
return !gloog_error;
}
-
#endif
diff --git a/gcc/graphite-clast-to-gimple.h b/gcc/graphite-clast-to-gimple.h
index fbb4efa..cd3cbca 100644
--- a/gcc/graphite-clast-to-gimple.h
+++ b/gcc/graphite-clast-to-gimple.h
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_GRAPHITE_CLAST_TO_GIMPLE_H
#define GCC_GRAPHITE_CLAST_TO_GIMPLE_H
+#include "graphite-cloog-util.h"
/* Data structure for CLooG program representation. */
typedef struct cloog_prog_clast {
@@ -37,7 +38,7 @@ typedef struct bb_pbb_def
}bb_pbb_def;
extern bool gloog (scop_p, htab_t);
-extern cloog_prog_clast scop_to_clast (scop_p);
+extern cloog_prog_clast scop_to_clast (scop_p, CloogState *);
extern void debug_clast_stmt (struct clast_stmt *);
extern void print_clast_stmt (FILE *, struct clast_stmt *);
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index 8ff0e43..f27ee5a 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -32,7 +32,8 @@ typedef const char *clast_name_p;
#ifndef CLOOG_ORG
/* CloogOptions compatibility. */
-#define build_cloog_prog(SCOP, PROG, OPT) build_cloog_prog (SCOP, PROG)
+#define build_cloog_prog(SCOP, PROG, OPT, STATE)\
+ build_cloog_prog (SCOP, PROG, STATE)
#define cloog_program_extract_scalars(PROG, SCATT, OPT)\
cloog_program_extract_scalars (PROG, SCATT)
#define cloog_program_scatter(PROG, SCATT, OPT)\
@@ -44,6 +45,19 @@ typedef const char *clast_name_p;
#define clast_expr_bin expr_bin
#define clast_pprint pprint
+/* CloogState compatibility. */
+#define CloogState void
+#define cloog_state_malloc() NULL
+#define cloog_state_free(STATE)
+#define cloog_loop_malloc(STATE) cloog_loop_malloc ()
+#define cloog_options_malloc(STATE) cloog_options_malloc ()
+#define cloog_statement_alloc(STATE, INDEX) cloog_statement_alloc (INDEX)
+#define new_Cloog_Domain_from_ppl_Pointset_Powerset(PSPS, NB, STATE)\
+ new_Cloog_Domain_from_ppl_Pointset_Powerset (PSPS)
+#define new_Cloog_Domain_from_ppl_Polyhedron(POLY, NB, STATE)\
+ new_Cloog_Domain_from_ppl_Polyhedron (POLY)
+#define cloog_domain_from_cloog_matrix(STATE, MAT, NB)\
+ cloog_domain_matrix2domain (MAT)
#endif
/* Adapt CLooG accessors from CLooG legacy to
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
index 33ee5cf..500443f 100644
--- a/gcc/graphite-cloog-util.c
+++ b/gcc/graphite-cloog-util.c
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "ppl_c.h"
#include "cloog/cloog.h"
#include "graphite-cloog-util.h"
+#include "graphite-cloog-compat.h"
/* Counts the number of constraints in PCS. */
@@ -228,10 +229,11 @@ new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *ph,
/* Creates a CloogDomain from polyhedron PH. */
CloogDomain *
-new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph)
+new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph, int nb_params,
+ CloogState *state ATTRIBUTE_UNUSED)
{
CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph);
- CloogDomain *res = cloog_domain_matrix2domain (mat);
+ CloogDomain *res = cloog_domain_from_cloog_matrix (state, mat, nb_params);
cloog_matrix_free (mat);
return res;
}
@@ -239,8 +241,9 @@ new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph)
/* Creates a CloogDomain from a pointset powerset PS. */
CloogDomain *
-new_Cloog_Domain_from_ppl_Pointset_Powerset (
- ppl_Pointset_Powerset_C_Polyhedron_t ps)
+new_Cloog_Domain_from_ppl_Pointset_Powerset
+ (ppl_Pointset_Powerset_C_Polyhedron_t ps, int nb_params,
+ CloogState *state ATTRIBUTE_UNUSED)
{
CloogDomain *res = NULL;
ppl_Pointset_Powerset_C_Polyhedron_iterator_t it, end;
@@ -257,7 +260,7 @@ new_Cloog_Domain_from_ppl_Pointset_Powerset (
CloogDomain *tmp;
ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (it, &ph);
- tmp = new_Cloog_Domain_from_ppl_Polyhedron (ph);
+ tmp = new_Cloog_Domain_from_ppl_Polyhedron (ph, nb_params, state);
if (res == NULL)
res = tmp;
diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
index da7b2e6..eaa48f3 100644
--- a/gcc/graphite-cloog-util.h
+++ b/gcc/graphite-cloog-util.h
@@ -25,9 +25,10 @@ along with GCC; see the file COPYING3. If not see
#include "graphite-cloog-compat.h"
CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
-CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
-CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset (
- ppl_Pointset_Powerset_C_Polyhedron_t);
+CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t,
+ int, CloogState *);
+CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset
+ (ppl_Pointset_Powerset_C_Polyhedron_t, int, CloogState *);
void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);
#endif /* GRAPHITE_CLOOG_UTIL_H */
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 61/65] Adapt to new CloogScattering abstraction, introduced in official CLooG versions (CLOOG_ORG).
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (50 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 64/65] Fix gamess: the only constant phi nodes with one argument are is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 60/65] Introduce compatibility to newer CLooG's CloogState and mask the use with macros where possible Sebastian Pop
` (15 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c (free_scattering): Change
CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
(CLOOG_ORG).
(build_cloog_prog): Same.
* graphite-cloog-compat.h (cloog_domain): Removed.
(cloog_scattering): New.
(cloog_set_domain): Removed.
(cloog_set_scattering): New.
(cloog_next_domain): Removed.
(cloog_next_scattering): New.
(cloog_set_next_domain): Removed.
(cloog_set_next_scattering): New.
(CloogScatteringList): New.
(CloogScattering): New.
(cloog_scattering_free): New.
(new_Cloog_Scattering_from_ppl_Polyhedron): New.
* graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron):
New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162608 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 21 +++++++++++++++++++++
gcc/ChangeLog.graphite | 21 +++++++++++++++++++++
gcc/graphite-clast-to-gimple.c | 25 +++++++++++++------------
gcc/graphite-cloog-compat.h | 30 ++++++++++++++++++++----------
gcc/graphite-cloog-util.c | 21 +++++++++++++++++++++
gcc/graphite-cloog-util.h | 2 ++
6 files changed, 98 insertions(+), 22 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2391126..dfa57af 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,26 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (free_scattering): Change
+ CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
+ (CLOOG_ORG).
+ (build_cloog_prog): Same.
+ * graphite-cloog-compat.h (cloog_domain): Removed.
+ (cloog_scattering): New.
+ (cloog_set_domain): Removed.
+ (cloog_set_scattering): New.
+ (cloog_next_domain): Removed.
+ (cloog_next_scattering): New.
+ (cloog_set_next_domain): Removed.
+ (cloog_set_next_scattering): New.
+ (CloogScatteringList): New.
+ (CloogScattering): New.
+ (cloog_scattering_free): New.
+ (new_Cloog_Scattering_from_ppl_Polyhedron): New.
+ * graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron):
+ New.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (build_cloog_prog): Extend with
CloogState.
(set_cloog_options): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b5e53b5..4916f91 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,26 @@
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-clast-to-gimple.c (free_scattering): Change
+ CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
+ (CLOOG_ORG).
+ (build_cloog_prog): Same.
+ * graphite-cloog-compat.h (cloog_domain): Removed.
+ (cloog_scattering): New.
+ (cloog_set_domain): Removed.
+ (cloog_set_scattering): New.
+ (cloog_next_domain): Removed.
+ (cloog_next_scattering): New.
+ (cloog_set_next_domain): Removed.
+ (cloog_set_next_scattering): New.
+ (CloogScatteringList): New.
+ (CloogScattering): New.
+ (cloog_scattering_free): New.
+ (new_Cloog_Scattering_from_ppl_Polyhedron): New.
+ * graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron):
+ New.
+
+2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (build_cloog_prog): Extend with
CloogState.
(set_cloog_options): Same.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 11867cf..138c0df 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1127,14 +1127,14 @@ translate_clast (sese region, loop_p context_loop, struct clast_stmt *stmt,
/* Free the SCATTERING domain list. */
static void
-free_scattering (CloogDomainList *scattering)
+free_scattering (CloogScatteringList *scattering)
{
while (scattering)
{
- CloogDomain *dom = cloog_domain (scattering);
- CloogDomainList *next = cloog_next_domain (scattering);
+ CloogScattering *dom = cloog_scattering (scattering);
+ CloogScatteringList *next = cloog_next_scattering (scattering);
- cloog_domain_free (dom);
+ cloog_scattering_free (dom);
free (scattering);
scattering = next;
}
@@ -1212,7 +1212,7 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
poly_bb_p pbb;
CloogLoop *loop_list = NULL;
CloogBlockList *block_list = NULL;
- CloogDomainList *scattering = NULL;
+ CloogScatteringList *scattering = NULL;
int nbs = 2 * max_nb_loops + 1;
int *scaldims;
@@ -1264,17 +1264,18 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
/* Build scattering list. */
{
/* XXX: Replace with cloog_domain_list_alloc(), when available. */
- CloogDomainList *new_scattering
- = (CloogDomainList *) xmalloc (sizeof (CloogDomainList));
+ CloogScatteringList *new_scattering
+ = (CloogScatteringList *) xmalloc (sizeof (CloogScatteringList));
ppl_Polyhedron_t scat;
- CloogDomain *dom;
+ CloogScattering *dom;
scat = PBB_TRANSFORMED_SCATTERING (pbb);
- dom = new_Cloog_Domain_from_ppl_Polyhedron (scat, scop_nb_params (scop),
- state);
+ dom = new_Cloog_Scattering_from_ppl_Polyhedron
+ (scat, scop_nb_params (scop), pbb_nb_scattering_transform (pbb),
+ state);
- cloog_set_next_domain (new_scattering, scattering);
- cloog_set_domain (new_scattering, dom);
+ cloog_set_next_scattering (new_scattering, scattering);
+ cloog_set_scattering (new_scattering, dom);
scattering = new_scattering;
}
}
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index f27ee5a..56b6bb3 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -58,6 +58,16 @@ typedef const char *clast_name_p;
new_Cloog_Domain_from_ppl_Polyhedron (POLY)
#define cloog_domain_from_cloog_matrix(STATE, MAT, NB)\
cloog_domain_matrix2domain (MAT)
+
+/* CloogScatteringList compatibility. */
+#define CloogScatteringList CloogDomainList
+#define CloogScattering CloogDomain
+#define cloog_set_next_scattering cloog_set_next_domain
+#define cloog_set_scattering cloog_set_domain
+#define cloog_scattering cloog_domain
+#define cloog_next_scattering cloog_next_domain
+#define cloog_scattering_free cloog_domain_free
+
#endif
/* Adapt CLooG accessors from CLooG legacy to
@@ -71,28 +81,28 @@ cloog_statement_usr (CloogStatement *cs)
return cs->usr;
}
-static inline CloogDomain *
-cloog_domain (CloogDomainList *dl)
+static inline CloogScattering *
+cloog_scattering (CloogScatteringList *sl)
{
- return dl->domain;
+ return sl->scatt;
}
static inline void
-cloog_set_domain (CloogDomainList *dl, CloogDomain *domain)
+cloog_set_scattering (CloogScatteringList *sl, CloogScattering *scatt)
{
- dl->domain = domain;
+ sl->scatt = scatt;
}
-static inline CloogDomainList *
-cloog_next_domain (CloogDomainList *dl)
+static inline CloogScatteringList *
+cloog_next_scattering (CloogScatteringList *sl)
{
- return dl->next;
+ return sl->next;
}
static inline void
-cloog_set_next_domain (CloogDomainList *dl, CloogDomainList *next)
+cloog_set_next_scattering (CloogScatteringList *sl, CloogScatteringList *next)
{
- dl->next = next;
+ sl->next = next;
}
static inline int
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
index 500443f..1770458 100644
--- a/gcc/graphite-cloog-util.c
+++ b/gcc/graphite-cloog-util.c
@@ -238,6 +238,27 @@ new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph, int nb_params,
return res;
}
+/* Create a CloogScattering from polyhedron PH. */
+
+CloogScattering *
+new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
+ int nb_params ATTRIBUTE_UNUSED,
+ int nb_scatt ATTRIBUTE_UNUSED,
+ CloogState *state ATTRIBUTE_UNUSED)
+{
+#ifdef CLOOG_ORG
+ CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph);
+ CloogScattering *res = cloog_scattering_from_cloog_matrix (state, mat,
+ nb_scatt,
+ nb_params);
+
+ cloog_matrix_free (mat);
+ return res;
+#else
+ return new_Cloog_Domain_from_ppl_Polyhedron (ph, nb_params, state);
+#endif
+}
+
/* Creates a CloogDomain from a pointset powerset PS. */
CloogDomain *
diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
index eaa48f3..d7758ce 100644
--- a/gcc/graphite-cloog-util.h
+++ b/gcc/graphite-cloog-util.h
@@ -27,6 +27,8 @@ along with GCC; see the file COPYING3. If not see
CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t,
int, CloogState *);
+CloogScattering *new_Cloog_Scattering_from_ppl_Polyhedron
+ (ppl_const_Polyhedron_t, int, int, CloogState *);
CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset
(ppl_Pointset_Powerset_C_Polyhedron_t, int, CloogState *);
void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 62/65] Remove cloog_initialize and cloog_finalize when using official CLooG releases.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (52 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 60/65] Introduce compatibility to newer CLooG's CloogState and mask the use with macros where possible Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 45/65] Unshare the scev before code generating it Sebastian Pop
` (13 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
This requires to initialize the Parma Polyhedra Library by graphite,
as newer CLooG versions are not bound to a PPL backend.
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite.c (graphite_initialize): Do not initialize
CLooG and initialize the Parma Polyhedra Library
manually when using CLOOG_ORG.
(graphite_finalize): Do not finalize CLooG and finalize
the Parma Polyhedra Library manually when using CLOOG_ORG.
* graphite-cloog-compat.h (cloog_initialize): Hide function
when using CLOOG_ORG.
(cloog_finalize): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162609 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 19 +++++++++++++++++++
gcc/ChangeLog.graphite | 11 +++++++++++
gcc/graphite-cloog-compat.h | 5 +++++
gcc/graphite.c | 8 ++++++++
4 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dfa57af..bdc5f26 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,24 @@
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite-cloog-util.c (oppose_constraint):
+ Extend loop counter's value range (CLOOG_ORG).
+ (cloog_matrix_to_ppl_constraint): Same.
+ (new_Constraint_System_from_Cloog_matrix): Same.
+ * graphite-cloog-compat.h (matrix_num_type): New.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * graphite.c (graphite_initialize): Do not initialize
+ CLooG and initialize the Parma Polyhedra Library
+ manually when using CLOOG_ORG.
+ (graphite_finalize): Do not finalize CLooG and finalize
+ the Parma Polyhedra Library manually when using CLOOG_ORG.
+ * graphite-cloog-compat.h (cloog_initialize): Hide function
+ when using CLOOG_ORG.
+ (cloog_finalize): Same.
+
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (free_scattering): Change
CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
(CLOOG_ORG).
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 4916f91..7a7b02c 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,16 @@
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+ * graphite.c (graphite_initialize): Do not initialize
+ CLooG and initialize the Parma Polyhedra Library
+ manually when using CLOOG_ORG.
+ (graphite_finalize): Do not finalize CLooG and finalize
+ the Parma Polyhedra Library manually when using CLOOG_ORG.
+ * graphite-cloog-compat.h (cloog_initialize): Hide function
+ when using CLOOG_ORG.
+ (cloog_finalize): Same.
+
+2010-07-18 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
* graphite-clast-to-gimple.c (free_scattering): Change
CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
(CLOOG_ORG).
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index 56b6bb3..c39b18e 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -29,6 +29,11 @@ typedef const struct clast_expr *clast_name_p;
typedef const char *clast_name_p;
#endif
+#ifdef CLOOG_ORG
+#define cloog_initialize()
+#define cloog_finalize()
+#endif
+
#ifndef CLOOG_ORG
/* CloogOptions compatibility. */
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 4bb4344..12dbd0c 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -61,6 +61,7 @@ along with GCC; see the file COPYING3. If not see
#include "cloog/cloog.h"
#include "ppl_c.h"
+#include "graphite-cloog-compat.h"
#include "graphite-ppl.h"
#include "graphite.h"
#include "graphite-poly.h"
@@ -200,6 +201,8 @@ print_graphite_statistics (FILE* file, VEC (scop_p, heap) *scops)
static bool
graphite_initialize (void)
{
+ int ppl_initialized;
+
if (number_of_loops () <= 1
/* FIXME: This limit on the number of basic blocks of a function
should be removed when the SCOP detection is faster. */
@@ -213,6 +216,10 @@ graphite_initialize (void)
recompute_all_dominators ();
initialize_original_copy_tables ();
+
+ ppl_initialized = ppl_initialize ();
+ gcc_assert (ppl_initialized == 0);
+
cloog_initialize ();
if (dump_file && dump_flags)
@@ -237,6 +244,7 @@ graphite_finalize (bool need_cfg_cleanup_p)
}
cloog_finalize ();
+ ppl_finalize ();
free_original_copy_tables ();
if (dump_file && dump_flags)
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 64/65] Fix gamess: the only constant phi nodes with one argument are is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (49 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 59/65] Adapt to new CLAST structure within upstream CLooG version and retain compatibility to CLooG Legacy Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 61/65] Adapt to new CloogScattering abstraction, introduced in official CLooG versions (CLOOG_ORG) Sebastian Pop
` (16 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-28 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only
constant phi nodes with one argument are is_gimple_min_invariant
and SSA_NAME_IS_DEFAULT_DEF.
* gfortran.dg/graphite/id-22.f: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162662 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 6 ++++++
gcc/ChangeLog.graphite | 8 ++++++++
gcc/graphite-sese-to-poly.c | 5 ++---
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gfortran.dg/graphite/id-22.f | 10 ++++++++++
5 files changed, 30 insertions(+), 3 deletions(-)
create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-22.f
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bdc5f26..3e01871 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only
+ constant phi nodes with one argument are is_gimple_min_invariant
+ and SSA_NAME_IS_DEFAULT_DEF.
+
2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-cloog-util.c (oppose_constraint):
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index fe58ec0..1d3e64d 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-07-28 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): The only
+ constant phi nodes with one argument are is_gimple_min_invariant
+ and SSA_NAME_IS_DEFAULT_DEF.
+
+ * gfortran.dg/graphite/id-22.f: New.
+
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite.c (graphite_initialize): Do not initialize
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 44c6588..38e408c 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2240,10 +2240,9 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi, sese region)
gcc_assert (gimple_phi_num_args (phi) == 1);
/* The phi node can be a non close phi node, when its argument is
- invariant, or when it is defined in the same loop as the phi node. */
+ invariant, or a default definition. */
if (is_gimple_min_invariant (arg)
- || SSA_NAME_IS_DEFAULT_DEF (arg)
- || gimple_bb (SSA_NAME_DEF_STMT (arg))->loop_father == bb->loop_father)
+ || SSA_NAME_IS_DEFAULT_DEF (arg))
{
propagate_expr_outside_region (res, arg, region);
gsi_next (psi);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c5d01bf..a388e00 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gfortran.dg/graphite/id-22.f: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/id-26.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-22.f b/gcc/testsuite/gfortran.dg/graphite/id-22.f
new file mode 100644
index 0000000..4b943f1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-22.f
@@ -0,0 +1,10 @@
+! { dg-options "-O3 -ffast-math" }
+
+ COMMON /NONEQ / UNZOR
+ DO ITS = 1, NTS
+ DO JATOM = 1, NAT
+ IF(IEF.EQ.5.OR.IEF.EQ.8)
+ * UNZOR = UNZOR + 8
+ ENDDO
+ ENDDO
+ END
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 50/65] Enhance region checks.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (61 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 56/65] Call scev_reset_htab when Graphite out-of-SSA has changed something Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 41/65] Special case non close-phi nodes with one argument in rewrite_close_phi_out_of_ssa Sebastian Pop
` (4 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-20 Vladimir Kargov <kargov@gmail.com>
* graphite-scop-detection.c (is_valid_stmt_p): New.
(is_valid_bb_p): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162354 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 96034ad..699a8a6 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,9 @@
2010-07-20 Vladimir Kargov <kargov@gmail.com>
+
+ * graphite-scop-detection.c (is_valid_stmt_p): New.
+ (is_valid_bb_p): New.
+
+2010-07-20 Vladimir Kargov <kargov@gmail.com>
Sebastian Pop <sebastian.pop@amd.com>
* cfgloop.c (is_loop_exit): Renamed loop_exits_to_bb_p.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 57/65] Reintroduce necessary CLooG accessors to graphite. Masked by CLOOG_ORG.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (55 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 42/65] Add testcase for PR42729 and fix handling of gimple_debug info Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 53/65] Propagate constant values or parametric expressions outside the scop region Sebastian Pop
` (10 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c: Include graphite-cloog-compat.h
conditionally (CLOOG_ORG).
* graphite-cloog-compat.h: New. Include graphite-cloog-compat.h.
(cloog_statement_usr): New.
(cloog_domain): Same.
(cloog_set_domain): Same.
(cloog_next_domain): Same.
(cloog_set_next_domain): Same.
(cloog_program_nb_scattdims): Same.
(cloog_program_set_nb_scattdims): Same.
(cloog_program_names): Same.
(cloog_program_set_names): Same.
(cloog_program_set_context): Same.
(cloog_program_set_loop): Same.
(cloog_program_blocklist): Same.
(cloog_program_set_blocklist): Same.
(cloog_program_scaldims): Same.
(cloog_program_set_scaldims): Same.
(cloog_names_nb_parameters): Same.
(cloog_names_set_nb_parameters): Same.
(cloog_names_parameters): Same.
(cloog_names_set_parameters): Same.
(cloog_names_set_nb_iterators): Same.
(cloog_names_set_iterators): Same.
(cloog_names_set_nb_scattering): Same.
(cloog_names_set_scattering): Same.
(cloog_statement_set_usr): Same.
(cloog_loop_set_next): Same.
(cloog_loop_set_domain): Same.
(cloog_loop_set_block): Same.
(cloog_block_list_next): Same.
(cloog_block_list_set_next):
(cloog_block_list_set_block): Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162604 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 36 +++++++
gcc/ChangeLog.graphite | 36 +++++++
gcc/graphite-clast-to-gimple.c | 1 +
gcc/graphite-cloog-compat.h | 210 ++++++++++++++++++++++++++++++++++++++++
gcc/graphite-cloog-util.h | 1 +
5 files changed, 284 insertions(+), 0 deletions(-)
create mode 100644 gcc/graphite-cloog-compat.h
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 559a2f8..0583fd6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,39 @@
+2010-08-02 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * graphite-clast-to-gimple.c: Include graphite-cloog-compat.h
+ conditionally (CLOOG_ORG).
+ * graphite-cloog-compat.h: New. Include graphite-cloog-compat.h.
+ (cloog_statement_usr): New.
+ (cloog_domain): Same.
+ (cloog_set_domain): Same.
+ (cloog_next_domain): Same.
+ (cloog_set_next_domain): Same.
+ (cloog_program_nb_scattdims): Same.
+ (cloog_program_set_nb_scattdims): Same.
+ (cloog_program_names): Same.
+ (cloog_program_set_names): Same.
+ (cloog_program_set_context): Same.
+ (cloog_program_set_loop): Same.
+ (cloog_program_blocklist): Same.
+ (cloog_program_set_blocklist): Same.
+ (cloog_program_scaldims): Same.
+ (cloog_program_set_scaldims): Same.
+ (cloog_names_nb_parameters): Same.
+ (cloog_names_set_nb_parameters): Same.
+ (cloog_names_parameters): Same.
+ (cloog_names_set_parameters): Same.
+ (cloog_names_set_nb_iterators): Same.
+ (cloog_names_set_iterators): Same.
+ (cloog_names_set_nb_scattering): Same.
+ (cloog_names_set_scattering): Same.
+ (cloog_statement_set_usr): Same.
+ (cloog_loop_set_next): Same.
+ (cloog_loop_set_domain): Same.
+ (cloog_loop_set_block): Same.
+ (cloog_block_list_next): Same.
+ (cloog_block_list_set_next):
+ (cloog_block_list_set_block): Same.
+
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Returns
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index bcdd3a9..cfc3c7a 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,39 @@
+2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+
+ * graphite-clast-to-gimple.c: Include graphite-cloog-compat.h
+ conditionally (CLOOG_ORG).
+ * graphite-cloog-compat.h: New. Include graphite-cloog-compat.h.
+ (cloog_statement_usr): New.
+ (cloog_domain): Same.
+ (cloog_set_domain): Same.
+ (cloog_next_domain): Same.
+ (cloog_set_next_domain): Same.
+ (cloog_program_nb_scattdims): Same.
+ (cloog_program_set_nb_scattdims): Same.
+ (cloog_program_names): Same.
+ (cloog_program_set_names): Same.
+ (cloog_program_set_context): Same.
+ (cloog_program_set_loop): Same.
+ (cloog_program_blocklist): Same.
+ (cloog_program_set_blocklist): Same.
+ (cloog_program_scaldims): Same.
+ (cloog_program_set_scaldims): Same.
+ (cloog_names_nb_parameters): Same.
+ (cloog_names_set_nb_parameters): Same.
+ (cloog_names_parameters): Same.
+ (cloog_names_set_parameters): Same.
+ (cloog_names_set_nb_iterators): Same.
+ (cloog_names_set_iterators): Same.
+ (cloog_names_set_nb_scattering): Same.
+ (cloog_names_set_scattering): Same.
+ (cloog_statement_set_usr): Same.
+ (cloog_loop_set_next): Same.
+ (cloog_loop_set_domain): Same.
+ (cloog_loop_set_block): Same.
+ (cloog_block_list_next): Same.
+ (cloog_block_list_set_next):
+ (cloog_block_list_set_block): Same.
+
2010-07-27 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_cross_bb_scalar_deps): Returns
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 90ea435..89a182c 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "graphite-scop-detection.h"
#include "graphite-clast-to-gimple.h"
#include "graphite-dependences.h"
+#include "graphite-cloog-compat.h"
/* This flag is set when an error occurred during the translation of
CLAST to Gimple. */
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
new file mode 100644
index 0000000..44f7157
--- /dev/null
+++ b/gcc/graphite-cloog-compat.h
@@ -0,0 +1,210 @@
+/* Compatibility layer for using upstream CLooG versions with
+ CLooG legacy code.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ Contributed by Andreas Simbuerger <simbuerg@fim.uni-passau.de>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef GRAPHITE_CLOOG_COMPAT_H
+#define GRAPHITE_CLOOG_COMPAT_H
+
+/* Adapt CLooG accessors from CLooG legacy to
+ newer CLooG versions. */
+
+#ifdef CLOOG_ORG
+
+static inline void *
+cloog_statement_usr (CloogStatement *cs)
+{
+ return cs->usr;
+}
+
+static inline CloogDomain *
+cloog_domain (CloogDomainList *dl)
+{
+ return dl->domain;
+}
+
+static inline void
+cloog_set_domain (CloogDomainList *dl, CloogDomain *domain)
+{
+ dl->domain = domain;
+}
+
+static inline CloogDomainList *
+cloog_next_domain (CloogDomainList *dl)
+{
+ return dl->next;
+}
+
+static inline void
+cloog_set_next_domain (CloogDomainList *dl, CloogDomainList *next)
+{
+ dl->next = next;
+}
+
+static inline int
+cloog_program_nb_scattdims (CloogProgram *prog)
+{
+ return prog->nb_scattdims;
+}
+
+static inline void
+cloog_program_set_nb_scattdims (CloogProgram *prog, int nb_scattdims)
+{
+ prog->nb_scattdims = nb_scattdims;
+}
+
+static inline CloogNames *
+cloog_program_names (CloogProgram *prog)
+{
+ return prog->names;
+}
+
+static inline void
+cloog_program_set_names (CloogProgram *prog, CloogNames *names)
+{
+ prog->names = names;
+}
+
+static inline void
+cloog_program_set_context (CloogProgram *prog, CloogDomain *domain)
+{
+ prog->context = domain;
+}
+
+static inline void
+cloog_program_set_loop (CloogProgram *prog, CloogLoop *loop)
+{
+ prog->loop = loop;
+}
+
+static inline CloogBlockList *
+cloog_program_blocklist (CloogProgram *prog)
+{
+ return prog->blocklist;
+}
+
+static inline void
+cloog_program_set_blocklist (CloogProgram *prog, CloogBlockList *bl)
+{
+ prog->blocklist = bl;
+}
+
+static inline int *
+cloog_program_scaldims (CloogProgram *prog)
+{
+ return prog->scaldims;
+}
+
+static inline void
+cloog_program_set_scaldims (CloogProgram *prog, int *s)
+{
+ prog->scaldims = s;
+}
+
+static inline int
+cloog_names_nb_parameters (CloogNames *names)
+{
+ return names->nb_parameters;
+}
+
+static inline void
+cloog_names_set_nb_parameters (CloogNames *names, int nb_parameters)
+{
+ names->nb_parameters = nb_parameters;
+}
+
+static inline char **
+cloog_names_parameters (CloogNames *names)
+{
+ return names->parameters;
+}
+
+static inline void
+cloog_names_set_parameters (CloogNames *names, char **parameters)
+{
+ names->parameters = parameters;
+}
+
+static inline void
+cloog_names_set_nb_iterators (CloogNames *names, int nb_iterators)
+{
+ names->nb_iterators = nb_iterators;
+}
+
+static inline void
+cloog_names_set_iterators (CloogNames *names, char **iterators)
+{
+ names->iterators = iterators;
+}
+
+static inline void
+cloog_names_set_nb_scattering (CloogNames *names, int nb_scattering)
+{
+ names->nb_scattering = nb_scattering;
+}
+
+static inline void
+cloog_names_set_scattering (CloogNames *names, char **scattering)
+{
+ names->scattering = scattering;
+}
+
+static inline void
+cloog_statement_set_usr (CloogStatement *cs, void *u)
+{
+ cs->usr = u;
+}
+
+static inline void
+cloog_loop_set_next (CloogLoop *loop, CloogLoop *next)
+{
+ loop->next = next;
+}
+
+static inline void
+cloog_loop_set_domain (CloogLoop *loop, CloogDomain *domain)
+{
+ loop->domain = domain;
+}
+
+static inline void
+cloog_loop_set_block (CloogLoop *loop, CloogBlock *block)
+{
+ loop->block = block;
+}
+
+static inline CloogBlockList *
+cloog_block_list_next (CloogBlockList *bl)
+{
+ return bl->next;
+}
+
+static inline void
+cloog_block_list_set_next (CloogBlockList *bl, CloogBlockList *next)
+{
+ bl->next = next;
+}
+
+static inline void
+cloog_block_list_set_block (CloogBlockList *bl, CloogBlock *block)
+{
+ bl->block = block;
+}
+#endif /* CLOOG_ORG */
+#endif /* GRAPHITE_CLOOG_COMPAT_H */
diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
index 3180b0e..da7b2e6 100644
--- a/gcc/graphite-cloog-util.h
+++ b/gcc/graphite-cloog-util.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#define GRAPHITE_CLOOG_UTIL_H
#include "cloog/cloog.h"
+#include "graphite-cloog-compat.h"
CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 45/65] Unshare the scev before code generating it.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (53 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 62/65] Remove cloog_initialize and cloog_finalize when using official CLooG releases Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 42/65] Add testcase for PR42729 and fix handling of gimple_debug info Sebastian Pop
` (12 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* sese.c (rename_uses): Call unshare_expr before force_gimple_operand.
* gcc.dg/graphite/id-23.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162253 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 4 ++++
gcc/ChangeLog.graphite | 6 ++++++
gcc/sese.c | 3 ++-
gcc/testsuite/ChangeLog | 4 ++++
gcc/testsuite/gcc.dg/graphite/id-23.c | 22 ++++++++++++++++++++++
5 files changed, 38 insertions(+), 1 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-23.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f153d76..29efa29 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * sese.c (rename_uses): Call unshare_expr before force_gimple_operand.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
SSA scalar phi nodes that can be scev_analyzable_p.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 1ddd731..d929c9a 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,11 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * sese.c (rename_uses): Call unshare_expr before force_gimple_operand.
+
+ * gcc.dg/graphite/id-23.c: New.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
SSA scalar phi nodes that can be scev_analyzable_p.
diff --git a/gcc/sese.c b/gcc/sese.c
index 9dbd76f..5ac7a2f 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -543,7 +543,8 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt,
&& !tree_contains_chrecs (new_expr, NULL));
/* Replace the old_name with the new_expr. */
- new_expr = force_gimple_operand (new_expr, &stmts, true, NULL);
+ new_expr = force_gimple_operand (unshare_expr (new_expr), &stmts,
+ true, NULL);
gsi_insert_seq_before (gsi_tgt, stmts, GSI_SAME_STMT);
replace_exp (use_p, new_expr);
set_rename (rename_map, old_name, new_expr);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c56694e..69e8a4c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/id-23.c: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gfortran.dg/graphite/id-20.f: Adjust testcase.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/id-23.c b/gcc/testsuite/gcc.dg/graphite/id-23.c
new file mode 100644
index 0000000..0f8a1f3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-23.c
@@ -0,0 +1,22 @@
+double *ZV_entries (void);
+void SubMtx_fillRowZV (int irow)
+{
+ double *rowvec = ZV_entries ();
+ double *entries;
+ int ii, ipivot, jrow, kk, m;
+ int *pivotsizes;
+
+ SubMtx_blockDiagonalInfo (&pivotsizes);
+
+ for (jrow = ipivot = kk = 0; jrow <= irow; ipivot++)
+ {
+ m = pivotsizes[ipivot];
+ if (jrow <= irow && irow < jrow + m)
+ for (ii = jrow; ii < irow; ii++)
+ {
+ rowvec[2*ii] = entries[2*kk];
+ rowvec[2*ii+1] = entries[2*kk+1];
+ }
+ jrow += m;
+ }
+}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 53/65] Propagate constant values or parametric expressions outside the scop region.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (56 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 57/65] Reintroduce necessary CLooG accessors to graphite. Masked by CLOOG_ORG Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 58/65] Make CLooG options compatible to newer CLooG releases and pass options to build_cloog_prog (CLOOG_ORG) Sebastian Pop
` (9 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (propagate_expr_outside_region): New.
(rewrite_close_phi_out_of_ssa): Propagate constant values or
parametric expressions outside the scop region.
(rewrite_cross_bb_scalar_deps): Same.
* sese.c (rename_uses): Use NULL_TREE instead of NULL for trees.
* gcc.dg/graphite/run-id-5.c: New.
* gcc.dg/graphite/run-id-6.c: New.
* gfortran.dg/graphite/id-21.f: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162446 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 8 +++
gcc/ChangeLog.graphite | 12 ++++
gcc/graphite-sese-to-poly.c | 85 ++++++++++++++++++++++++---
gcc/sese.c | 2 +-
gcc/testsuite/ChangeLog | 6 ++
gcc/testsuite/gcc.dg/graphite/run-id-5.c | 54 ++++++++++++++++++
gcc/testsuite/gcc.dg/graphite/run-id-6.c | 55 ++++++++++++++++++
gcc/testsuite/gfortran.dg/graphite/id-21.f | 20 +++++++
8 files changed, 231 insertions(+), 11 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-5.c
create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-6.c
create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-21.f
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bc50e30..57bcf1e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (propagate_expr_outside_region): New.
+ (rewrite_close_phi_out_of_ssa): Propagate constant values or
+ parametric expressions outside the scop region.
+ (rewrite_cross_bb_scalar_deps): Same.
+ * sese.c (rename_uses): Use NULL_TREE instead of NULL for trees.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
SSA_NAME_DEF_STMT only on SSA_NAMEs.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 1ae2bf2..0ed18ef 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,17 @@
2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (propagate_expr_outside_region): New.
+ (rewrite_close_phi_out_of_ssa): Propagate constant values or
+ parametric expressions outside the scop region.
+ (rewrite_cross_bb_scalar_deps): Same.
+ * sese.c (rename_uses): Use NULL_TREE instead of NULL for trees.
+
+ * gcc.dg/graphite/run-id-5.c: New.
+ * gcc.dg/graphite/run-id-6.c: New.
+ * gfortran.dg/graphite/id-21.f: New.
+
+2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (rewrite_phi_out_of_ssa): Use
SSA_NAME_DEF_STMT only on SSA_NAMEs.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 084dd31..574a25b 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2182,6 +2182,45 @@ scalar_close_phi_node_p (gimple phi)
return (gimple_phi_num_args (phi) == 1);
}
+/* For a definition DEF in REGION, propagates the expression EXPR in
+ all the uses of DEF outside REGION. */
+
+static void
+propagate_expr_outside_region (tree def, tree expr, sese region)
+{
+ imm_use_iterator imm_iter;
+ gimple use_stmt;
+ gimple_seq stmts;
+ bool replaced_once = false;
+
+ gcc_assert (TREE_CODE (def) == SSA_NAME
+ && bb_in_sese_p (gimple_bb (SSA_NAME_DEF_STMT (def)), region));
+
+ expr = force_gimple_operand (unshare_expr (expr), &stmts, true,
+ NULL_TREE);
+
+ FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
+ if (!is_gimple_debug (use_stmt)
+ && !bb_in_sese_p (gimple_bb (use_stmt), region))
+ {
+ ssa_op_iter iter;
+ use_operand_p use_p;
+
+ FOR_EACH_PHI_OR_STMT_USE (use_p, use_stmt, iter, SSA_OP_ALL_USES)
+ if (operand_equal_p (def, USE_FROM_PTR (use_p), 0)
+ && (replaced_once = true))
+ replace_exp (use_p, expr);
+
+ update_stmt (use_stmt);
+ }
+
+ if (replaced_once)
+ {
+ gsi_insert_seq_on_edge (SESE_ENTRY (region), stmts);
+ gsi_commit_edge_inserts ();
+ }
+}
+
/* Rewrite out of SSA the reduction phi node at PSI by creating a zero
dimension array for it. */
@@ -2201,20 +2240,36 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi, sese region)
before Graphite: see canonicalize_loop_closed_ssa_form. */
gcc_assert (gimple_phi_num_args (phi) == 1);
- /* If res is scev analyzable, it is safe to ignore the close phi
- node: it will be code generated in the out of Graphite pass. */
- if (scev_analyzable_p (res, region))
- {
- gsi_next (psi);
- return;
- }
-
/* The phi node can be a non close phi node, when its argument is
invariant, or when it is defined in the same loop as the phi node. */
if (is_gimple_min_invariant (arg)
|| SSA_NAME_IS_DEFAULT_DEF (arg)
|| gimple_bb (SSA_NAME_DEF_STMT (arg))->loop_father == bb->loop_father)
stmt = gimple_build_assign (res, arg);
+
+ /* If res is scev analyzable and is not a scalar value, it is safe
+ to ignore the close phi node: it will be code generated in the
+ out of Graphite pass. */
+ else if (scev_analyzable_p (res, region))
+ {
+ loop_p loop = loop_containing_stmt (SSA_NAME_DEF_STMT (res));
+ tree scev;
+
+ if (!loop_in_sese_p (loop, region))
+ {
+ loop = loop_containing_stmt (SSA_NAME_DEF_STMT (arg));
+ scev = scalar_evolution_in_region (region, loop, arg);
+ scev = compute_overall_effect_of_inner_loop (loop, scev);
+ }
+ else
+ scev = scalar_evolution_in_region (region, loop, res);
+
+ if (tree_does_not_contain_chrecs (scev))
+ propagate_expr_outside_region (res, scev, region);
+
+ gsi_next (psi);
+ return;
+ }
else
{
tree zero_dim_array = create_zero_dim_array (var, "Close_Phi");
@@ -2428,10 +2483,20 @@ rewrite_cross_bb_scalar_deps (sese region, gimple_stmt_iterator *gsi)
return;
}
- if (!is_gimple_reg (def)
- || scev_analyzable_p (def, region))
+ if (!is_gimple_reg (def))
return;
+ if (scev_analyzable_p (def, region))
+ {
+ loop_p loop = loop_containing_stmt (SSA_NAME_DEF_STMT (def));
+ tree scev = scalar_evolution_in_region (region, loop, def);
+
+ if (tree_does_not_contain_chrecs (scev))
+ propagate_expr_outside_region (def, scev, region);
+
+ return;
+ }
+
def_bb = gimple_bb (stmt);
FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
diff --git a/gcc/sese.c b/gcc/sese.c
index 5ac7a2f..651b8fb 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -544,7 +544,7 @@ rename_uses (gimple copy, htab_t rename_map, gimple_stmt_iterator *gsi_tgt,
/* Replace the old_name with the new_expr. */
new_expr = force_gimple_operand (unshare_expr (new_expr), &stmts,
- true, NULL);
+ true, NULL_TREE);
gsi_insert_seq_before (gsi_tgt, stmts, GSI_SAME_STMT);
replace_exp (use_p, new_expr);
set_rename (rename_map, old_name, new_expr);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8bdc024..e3c3dbb 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/run-id-5.c: New.
+ * gcc.dg/graphite/run-id-6.c: New.
+ * gfortran.dg/graphite/id-21.f: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/id-24.c: New.
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
diff --git a/gcc/testsuite/gcc.dg/graphite/run-id-5.c b/gcc/testsuite/gcc.dg/graphite/run-id-5.c
new file mode 100644
index 0000000..9005c43
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/run-id-5.c
@@ -0,0 +1,54 @@
+/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model -fno-tree-scev-cprop -fgraphite-identity" } */
+/* { dg-require-effective-target vect_int } */
+
+/* gcc.dg/vect/no-scevccp-outer-22.c was miscompiled by Graphite.
+ Adding it here to always test it with Graphite. */
+
+#include <stdarg.h>
+
+extern void abort ();
+#define N 40
+
+int a[N];
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ /* inner-loop index j used after the inner-loop */
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j+=2) {
+ sum += j;
+ }
+ a[i] = sum + j;
+ }
+}
+
+int main (void)
+{
+ int i,j;
+ int sum;
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j+=2)
+ sum += j;
+ if (a[i] != sum + j)
+ abort();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/graphite/run-id-6.c b/gcc/testsuite/gcc.dg/graphite/run-id-6.c
new file mode 100644
index 0000000..dafa7f8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/run-id-6.c
@@ -0,0 +1,55 @@
+/* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model -fno-tree-scev-cprop -fgraphite-identity" } */
+/* { dg-require-effective-target vect_int } */
+
+/* gcc.dg/vect/no-scevccp-outer-4.c was miscompiled by Graphite.
+ Adding it here to always test it with Graphite. */
+
+#include <stdarg.h>
+
+extern void abort ();
+#define N 40
+
+int a[N];
+
+/* induction variable k advances through inner and outer loops. */
+
+__attribute__ ((noinline)) int
+foo (int n){
+ int i,j,k=0;
+ int sum;
+
+ if (n<=0)
+ return 0;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < n; j+=2) {
+ sum += k++;
+ }
+ a[i] = sum + j;
+ }
+}
+
+int main (void)
+{
+ int i,j,k=0;
+ int sum;
+
+ for (i=0; i<N; i++)
+ a[i] = i;
+
+ foo (N);
+
+ /* check results: */
+ for (i=0; i<N; i++)
+ {
+ sum = 0;
+ for (j = 0; j < N; j+=2)
+ sum += k++;
+ if (a[i] != sum + j)
+ abort();
+ }
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-21.f b/gcc/testsuite/gfortran.dg/graphite/id-21.f
new file mode 100644
index 0000000..4fa047e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-21.f
@@ -0,0 +1,20 @@
+ MODULE LES3D_DATA
+ DOUBLE PRECISION,ALLOCATABLE,DIMENSION(:,:,:) ::
+ > P, T, H
+ DOUBLE PRECISION,ALLOCATABLE,DIMENSION(:,:,:,:) ::
+ > HF
+ DOUBLE PRECISION,ALLOCATABLE,DIMENSION(:,:,:,:,:) ::
+ > Q
+ END MODULE LES3D_DATA
+ USE LES3D_DATA
+ DO K = 1, KMAX - 1
+ DO J = 1, JMAX - 1
+ DO I = 1, I2
+ T(I,J,K) = (EI - HF(I,J,K,1)) / HF(I,J,K,3)
+ ENDDO
+ P(1:I2,J,K) = Q(1:I2,J,K,1,M) * HF(1:I2,J,K,4) * T(1:I2,J,K)
+ IF(ISGSK .EQ. 1) H(1:I2,J,K) =
+ > (Q(1:I2,J,K,5,M) + P(1:I2,J,K))
+ END DO
+ ENDDO
+ END
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 54/65] Call scev_analyzable_p only on is_gimple_reg.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (58 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 58/65] Make CLooG options compatible to newer CLooG releases and pass options to build_cloog_prog (CLOOG_ORG) Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 63/65] Fix typos Sebastian Pop
` (7 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-26 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c
(rewrite_commutative_reductions_out_of_ssa_loop): Call
scev_analyzable_p only on is_gimple_reg
* gcc.dg/graphite/id-25.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162555 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 6 +++++
gcc/ChangeLog.graphite | 8 +++++++
gcc/graphite-sese-to-poly.c | 5 +++-
gcc/testsuite/ChangeLog | 4 +++
gcc/testsuite/gcc.dg/graphite/id-25.c | 34 +++++++++++++++++++++++++++++++++
5 files changed, 56 insertions(+), 1 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/graphite/id-25.c
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 57bcf1e..0f07a8b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c
+ (rewrite_commutative_reductions_out_of_ssa_loop): Call
+ scev_analyzable_p only on is_gimple_reg
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* graphite-sese-to-poly.c (propagate_expr_outside_region): New.
(rewrite_close_phi_out_of_ssa): Propagate constant values or
parametric expressions outside the scop region.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 0ed18ef..65607ec 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-07-26 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c
+ (rewrite_commutative_reductions_out_of_ssa_loop): Call
+ scev_analyzable_p only on is_gimple_reg
+
+ * gcc.dg/graphite/id-25.c: New.
+
2010-07-22 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (propagate_expr_outside_region): New.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 574a25b..ae8518f 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2950,12 +2950,15 @@ rewrite_commutative_reductions_out_of_ssa_loop (loop_p loop,
{
gimple_stmt_iterator gsi;
edge exit = single_exit (loop);
+ tree res;
if (!exit)
return;
for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi))
- if (!scev_analyzable_p (gimple_phi_result (gsi_stmt (gsi)), region))
+ if ((res = gimple_phi_result (gsi_stmt (gsi)))
+ && is_gimple_reg (res)
+ && !scev_analyzable_p (res, region))
rewrite_commutative_reductions_out_of_ssa_close_phi (gsi_stmt (gsi),
reductions);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e3c3dbb..9197cb2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * gcc.dg/graphite/id-25.c: New.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* gcc.dg/graphite/run-id-5.c: New.
* gcc.dg/graphite/run-id-6.c: New.
* gfortran.dg/graphite/id-21.f: New.
diff --git a/gcc/testsuite/gcc.dg/graphite/id-25.c b/gcc/testsuite/gcc.dg/graphite/id-25.c
new file mode 100644
index 0000000..b719972
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-25.c
@@ -0,0 +1,34 @@
+typedef struct
+{
+ int mvd[2][(16/4)][(16/4)][2];
+} Macroblock;
+typedef struct
+{
+ int part_size[8][2];
+} InputParameters;
+typedef struct
+{
+ Macroblock *mb_data;
+ short****** pred_mv;
+ short****** all_mv;
+} ImageParameters;
+extern InputParameters *input;
+extern ImageParameters *img;
+int writeMotionVector8x8 (void)
+{
+ int i, j, k, l, m;
+ int step_h = input->part_size[7][0];
+ int step_v = input->part_size[7][1];
+ Macroblock* currMB = &img->mb_data[9];
+ int refindex = 0;
+ short****** all_mv = img->all_mv;
+ short****** pred_mv = img->pred_mv;
+
+ for (k=0; k<2; k++)
+ {
+ int curr_mvd = all_mv[2][8][0][8][7][8] - pred_mv[2][7][0][8][7][0];
+ for (l=0; l < step_v; l++)
+ for (m=0; m < step_h; m++)
+ currMB->mvd[0][8][9][8] = curr_mvd;
+ }
+}
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 63/65] Fix typos.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (59 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 54/65] Call scev_analyzable_p only on is_gimple_reg Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 56/65] Call scev_reset_htab when Graphite out-of-SSA has changed something Sebastian Pop
` (6 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162611 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog.graphite | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 7a7b02c..fe58ec0 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -9,7 +9,7 @@
when using CLOOG_ORG.
(cloog_finalize): Same.
-2010-07-18 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
+2010-07-27 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
* graphite-clast-to-gimple.c (free_scattering): Change
CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
@@ -735,7 +735,7 @@
2010-04-11 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
- * graphite-blocking.c (pbb_strip_mine_profitable_p): Resolve
+ * graphite-blocking.c (pbb_strip_mine_profitable_p): Resolve
CLooG's value_* macros to their respective mpz_* counterparts.
* graphite-clast-to-gimple.c (clast_to_gcc_expression): Same.
(graphite_create_new_loop_guard): Same.
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH 41/65] Special case non close-phi nodes with one argument in rewrite_close_phi_out_of_ssa.
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (62 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 50/65] Enhance region checks Sebastian Pop
@ 2010-08-02 20:25 ` Sebastian Pop
2010-08-02 20:25 ` [PATCH 65/65] Fix miscompile of 416.gamess Sebastian Pop
` (3 subsequent siblings)
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-02 20:25 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Special
case non close-phi nodes with one argument.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162249 138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/ChangeLog | 5 +++++
gcc/ChangeLog.graphite | 5 +++++
gcc/graphite-sese-to-poly.c | 28 ++++++++++++++++++++--------
3 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 524376d..07ee095 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Special
+ case non close-phi nodes with one argument.
+
+2010-08-02 Sebastian Pop <sebastian.pop@amd.com>
+
* sese.h (scev_analyzable_p): Scevs could be expressions without
chrecs and still be scev_analyzable_p.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index a93e035..965ed25 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+ * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Special
+ case non close-phi nodes with one argument.
+
+2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
* sese.h (scev_analyzable_p): Scevs could be expressions without
chrecs and still be scev_analyzable_p.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 5a8db3d..bea9c9f 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2203,22 +2203,34 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
gimple phi = gsi_stmt (*psi);
tree res = gimple_phi_result (phi);
tree var = SSA_NAME_VAR (res);
- tree zero_dim_array = create_zero_dim_array (var, "Close_Phi");
- gimple_stmt_iterator gsi = gsi_after_labels (gimple_bb (phi));
- gimple stmt = gimple_build_assign (res, zero_dim_array);
+ basic_block bb = gimple_bb (phi);
+ gimple_stmt_iterator gsi = gsi_after_labels (bb);
tree arg = gimple_phi_arg_def (phi, 0);
+ gimple stmt;
/* Note that loop close phi nodes should have a single argument
because we translated the representation into a canonical form
before Graphite: see canonicalize_loop_closed_ssa_form. */
gcc_assert (gimple_phi_num_args (phi) == 1);
- if (TREE_CODE (arg) == SSA_NAME
- && !SSA_NAME_IS_DEFAULT_DEF (arg))
- insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
+ /* The phi node can be a non close phi node, when its argument is
+ invariant, or when it is defined in the same loop as the phi node. */
+ if (is_gimple_min_invariant (arg)
+ || gimple_bb (SSA_NAME_DEF_STMT (arg))->loop_father == bb->loop_father)
+ stmt = gimple_build_assign (res, arg);
else
- insert_out_of_ssa_copy_on_edge (single_pred_edge (gimple_bb (phi)),
- zero_dim_array, arg);
+ {
+ tree zero_dim_array = create_zero_dim_array (var, "Close_Phi");
+
+ stmt = gimple_build_assign (res, zero_dim_array);
+
+ if (TREE_CODE (arg) == SSA_NAME
+ && !SSA_NAME_IS_DEFAULT_DEF (arg))
+ insert_out_of_ssa_copy (zero_dim_array, arg, SSA_NAME_DEF_STMT (arg));
+ else
+ insert_out_of_ssa_copy_on_edge (single_pred_edge (bb),
+ zero_dim_array, arg);
+ }
remove_phi_node (psi, false);
gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
--
1.7.0.4
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 00/65] Merge from the Graphite branch to trunk
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (64 preceding siblings ...)
2010-08-02 20:25 ` [PATCH 65/65] Fix miscompile of 416.gamess Sebastian Pop
@ 2010-08-03 2:52 ` Jack Howarth
2010-08-03 2:55 ` Jack Howarth
2010-08-05 15:58 ` Jack Howarth
2010-08-11 20:54 ` Sebastian Pop
67 siblings, 1 reply; 74+ messages in thread
From: Jack Howarth @ 2010-08-03 2:52 UTC (permalink / raw)
To: Sebastian Pop; +Cc: gcc-patches, Tobias Grosser, gcc-graphite
On Mon, Aug 02, 2010 at 03:19:33PM -0500, Sebastian Pop wrote:
> Hi,
>
> This patch-set merges the changes that went into the Graphite branch
> for the past two months. These changes are stable: the automatic
> testers passed bootstrap and CPU2006 benchmarks with no fails and with
> various Graphite flag configurations.
>
Sebastian,
Other than the remaining induct performance regression,
the Polyhedron 2005 results look much improved for -fgraphite-identity
with either little change or an actual improvement.
Jack
r162829 with 65 patches from graphite on x86_64-apple-darwin10.
Configured with: ../gcc-4.6-20100802/configure --prefix=/sw --prefix=/sw/lib/gcc4.6 --mandir=/sw/share/man --infodir=/sw/lib/gcc4.6/info --enable-languages=c,c++,fortran,objc,obj-c++,java --with-gmp=/sw --with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.6 --enable-lto --enable-checking=yes
nolto = -ffast-math -funroll-loops -O3 -fno-protect-parens
nolto+graphite = -ffast-math -funroll-loops -O3 -fno-protect-parens -fgraphite-identity
lto = -ffast-math -funroll-loops -O3 -flto -fwhole-program -fno-protect-parens
lto+graphite = -ffast-math -funroll-loops -O3 -flto -fwhole-program -fno-protect-parens -fgraphite-identity
Runtime benchmarks (seconds)
Polyhedron nolto lto
2005 --------------- ----------------
benchmark - graphite - graphite
ac 7.86 7.86 7.85 7.85
aermod 18.04 17.43 18.73 17.64
air 5.62 5.59 5.54 5.52
capacita 33.35 33.11 33.24 33.24
channel 1.84 1.84 1.84 1.84
doduc 26.07 26.34 25.81 26.04
fatigue 7.93 7.94 5.92 5.83
gas_dyn 4.43 4.42 4.41 4.40
induct 13.34 20.29 13.36 20.22
linpk 15.43 15.46 15.43 15.45
mdbx 11.37 11.39 11.38 11.38
nf 30.53 30.40 30.45 30.50
protein 34.55 33.66 33.74 33.12
rnflow 23.68 23.59 29.08 29.05
test_fpu 8.36 8.34 8.24 8.29
tfft 1.87 1.87 1.87 1.87
Compile time benchmarks (seconds)
Polyhedron nolto lto
2005 --------------- ----------------
benchmark - graphite - graphite
ac 1.93 1.99 4.11 3.81
aermod 70.42 72.21 127.25 131.63
air 4.16 5.42 7.94 9.32
capacita 2.90 2.93 5.65 5.73
channel 1.00 1.33 2.04 2.72
doduc 9.38 9.74 18.73 19.37
fatigue 3.16 3.20 6.15 6.21
gas_dyn 5.14 5.43 12.47 12.88
induct 7.31 7.95 13.80 14.61
linpk 1.26 1.72 1.91 2.49
mdbx 2.95 3.16 5.67 6.03
nf 3.97 4.14 8.51 8.71
protein 8.45 8.63 17.92 18.33
rnflow 10.64 10.83 22.08 22.42
test_fpu 7.49 7.71 13.97 14.23
tfft 1.21 1.25 1.85 1.93
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 00/65] Merge from the Graphite branch to trunk
2010-08-03 2:52 ` [PATCH 00/65] Merge from the Graphite branch to trunk Jack Howarth
@ 2010-08-03 2:55 ` Jack Howarth
2010-08-03 3:07 ` Sebastian Pop
0 siblings, 1 reply; 74+ messages in thread
From: Jack Howarth @ 2010-08-03 2:55 UTC (permalink / raw)
To: Sebastian Pop; +Cc: gcc-patches, Tobias Grosser, gcc-graphite
On Mon, Aug 02, 2010 at 10:52:16PM -0400, Jack Howarth wrote:
>
> nolto = -ffast-math -funroll-loops -O3 -fno-protect-parens
> nolto+graphite = -ffast-math -funroll-loops -O3 -fno-protect-parens -fgraphite-identity
> lto = -ffast-math -funroll-loops -O3 -flto -fwhole-program -fno-protect-parens
> lto+graphite = -ffast-math -funroll-loops -O3 -flto -fwhole-program -fno-protect-parens -fgraphite-identity
>
Opps. Minor correction. The actual runs where -fwhopr rather than -flto.
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 00/65] Merge from the Graphite branch to trunk
2010-08-03 2:55 ` Jack Howarth
@ 2010-08-03 3:07 ` Sebastian Pop
2010-08-07 10:26 ` Jack Howarth
0 siblings, 1 reply; 74+ messages in thread
From: Sebastian Pop @ 2010-08-03 3:07 UTC (permalink / raw)
To: Jack Howarth; +Cc: gcc-patches, Tobias Grosser, gcc-graphite
On Mon, Aug 2, 2010 at 21:55, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> On Mon, Aug 02, 2010 at 10:52:16PM -0400, Jack Howarth wrote:
>>
>> nolto = -ffast-math -funroll-loops -O3 -fno-protect-parens
>> nolto+graphite = -ffast-math -funroll-loops -O3 -fno-protect-parens -fgraphite-identity
>> lto = -ffast-math -funroll-loops -O3 -flto -fwhole-program -fno-protect-parens
>> lto+graphite = -ffast-math -funroll-loops -O3 -flto -fwhole-program -fno-protect-parens -fgraphite-identity
>>
>
> Opps. Minor correction. The actual runs where -fwhopr rather than -flto.
>
Thanks for running these measurements.
It looks like the run time regressions that we saw with -O3 and
graphite identity are almost gone, except for induct.
I have not merged the last patches improving the graphite code
generation with more signed types (that would enable some more loops
to be vectorized). These patches are still miscompiling some SPEC
benchmarks. I will work a bit more on that front and submit them
separately. Hopefully they will stabilize faster.
Sebastian
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 00/65] Merge from the Graphite branch to trunk
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (65 preceding siblings ...)
2010-08-03 2:52 ` [PATCH 00/65] Merge from the Graphite branch to trunk Jack Howarth
@ 2010-08-05 15:58 ` Jack Howarth
2010-08-11 20:54 ` Sebastian Pop
67 siblings, 0 replies; 74+ messages in thread
From: Jack Howarth @ 2010-08-05 15:58 UTC (permalink / raw)
To: Sebastian Pop; +Cc: gcc-patches, Tobias Grosser, gcc-graphite
On Mon, Aug 02, 2010 at 03:19:33PM -0500, Sebastian Pop wrote:
> Hi,
>
> This patch-set merges the changes that went into the Graphite branch
> for the past two months. These changes are stable: the automatic
> testers passed bootstrap and CPU2006 benchmarks with no fails and with
> various Graphite flag configurations.
>
> Note that some of the patches contain only a change in
> ChangeLog.graphite, these are either already in trunk, or implement
> functionality that is not stable enough, and will remain for now in
> the branch. These changes are those linked to the new SCoP detection
> algorithm.
>
> I am testing this merge on amd64-linux. I will wait for 48 hours to
> let reviewers enough time to re-review these patches. All these
> changes have already been discussed prior to their commit to the
> Graphite branch. If there are other changes before committing to
> trunk, I will implement the needed changes.
>
> Thanks,
> Sebastian
>
> grosser (7):
> Add analysis pass to build the refined program structure tree.
> Skeleton for the new SCoP detection.
> Fix refined region tree nesting.
> Resolve CLooG's value_* macros to their respective mpz_*
> counterparts.
> Move cloog-related functions from graphite-ppl.{c,h} to new
> graphite-cloog-util.{c,h}.
> Partially removing cloog.h and graphite-clast-to-gimple.h where
> possible. Removing unused function check_poly_representation.
> Fix flipped condition using mpz_sgn.
>
> spop (58):
> Fix invariant phi node removal.
> Fix type of integer_one_node for fold_build of POINTER_PLUS_EXPR.
> Use size_one_node.
> Fix comments and indentation.
> Do not gather loop exit conditions on the basic blocks outside the
> loop.
> Call compute_overall_effect_of_inner_loop from instantiate_scev_name.
> Don't call pbb_to_depth_to_oldiv from compute_type_for_level.
> Launch dotty in background.
> Detect commutative reductions in all the scops before rewriting out
> of SSA all the other scalar dependences.
> Remove insert_copyout and insert_copyin.
> Also rewrite out of SSA scalar dependences going outside the SCoP
> region.
> Remove rename_nb_iterations and rename_sese_parameters
> Schedule a copy_prop pass before graphite.
> Add more debug counter guards.
> Split rewrite_cross_bb_scalar_deps_out_of_ssa out from
> rewrite_reductions_out_of_ssa.
> Always insert out of SSA copies on edges except for loop->latch.
> Fix testcase: call abort.
> Early return in rewrite_commutative_reductions_out_of_ssa when
> flag_associative_math is not set.
> Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps.
> Remove copy_renames.
> Replace map with rename_map.
> Remove dead code.
> Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from
> rewrite_cross_bb_phi_deps.
> Fix 416.gamess miscompile: special case the rewrite of degenerate phi
> nodes.
> Print bbs in refined region tree.
> Add testcase for miscompile in gamess.
> Remove insert_loop_close_phis.
> Remove expand_scalar_variables_ hack.
> chrec_apply should only apply to the specified variable.
> Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps.
> Remove uses of loop->single_iv.
> Bump the size of scevs.
> Scevs could be expressions without chrecs and still be
> scev_analyzable_p.
> Special case non close-phi nodes with one argument in
> rewrite_close_phi_out_of_ssa.
> Add testcase for PR42729 and fix handling of gimple_debug info.
> Correctly handle SSA_NAME_IS_DEFAULT_DEF in
> rewrite_close_phi_out_of_ssa.
> Do not rewrite out of SSA scalar phi nodes that can be
> scev_analyzable_p.
> Unshare the scev before code generating it.
> Add testcase for PR20742.
> Do not translate out-of-SSA close phi nodes that can be analyzed with
> scev.
> Dot refined regions.
> Add loop_exits_from_bb_p.
> Enhance region checks.
> Do not instantiate default definitions in instantiate_scev_name.
> Use SSA_NAME_DEF_STMT only on SSA_NAMEs.
> Propagate constant values or parametric expressions outside the scop
> region.
> Call scev_analyzable_p only on is_gimple_reg.
> Fix tonto: call propagate_expr_outside_region.
> Call scev_reset_htab when Graphite out-of-SSA has changed something.
> Reintroduce necessary CLooG accessors to graphite. Masked by
> CLOOG_ORG.
> Make CLooG options compatible to newer CLooG releases and pass
> options to build_cloog_prog (CLOOG_ORG).
> Adapt to new CLAST structure within upstream CLooG version and retain
> compatibility to CLooG Legacy.
> Introduce compatibility to newer CLooG's CloogState and mask the use
> with macros where possible.
> Adapt to new CloogScattering abstraction, introduced in official
> CLooG versions (CLOOG_ORG).
> Remove cloog_initialize and cloog_finalize when using official CLooG
> releases.
> Fix typos.
> Fix gamess: the only constant phi nodes with one argument are
> is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF.
> Fix miscompile of 416.gamess.
>
> gcc/ChangeLog | 552 +++++++++++++++
> gcc/ChangeLog.graphite | 704 ++++++++++++++++++-
> gcc/Makefile.in | 9 +-
> gcc/cfgloop.c | 20 +-
> gcc/cfgloop.h | 7 +-
> gcc/dbgcnt.def | 1 +
> gcc/graphite-blocking.c | 1 -
> gcc/graphite-clast-to-gimple.c | 356 ++++------
> gcc/graphite-clast-to-gimple.h | 6 +-
> gcc/graphite-cloog-compat.h | 263 +++++++
> gcc/graphite-cloog-util.c | 299 ++++++++
> gcc/graphite-cloog-util.h | 36 +
> gcc/graphite-dependences.c | 5 +-
> gcc/graphite-interchange.c | 3 +-
> gcc/graphite-poly.c | 7 +-
> gcc/graphite-ppl.c | 248 +-------
> gcc/graphite-ppl.h | 6 -
> gcc/graphite-scop-detection.c | 3 +-
> gcc/graphite-sese-to-poly.c | 544 ++++++++-------
> gcc/graphite-sese-to-poly.h | 5 +-
> gcc/graphite.c | 32 +-
> gcc/params.def | 2 +-
> gcc/passes.c | 7 +-
> gcc/sese.c | 1062 ++++------------------------
> gcc/sese.h | 23 +-
> gcc/testsuite/ChangeLog | 54 ++
> gcc/testsuite/gcc.dg/graphite/id-20.c | 26 +
> gcc/testsuite/gcc.dg/graphite/id-22.c | 15 +
> gcc/testsuite/gcc.dg/graphite/id-23.c | 22 +
> gcc/testsuite/gcc.dg/graphite/id-24.c | 22 +
> gcc/testsuite/gcc.dg/graphite/id-25.c | 34 +
> gcc/testsuite/gcc.dg/graphite/id-26.c | 24 +
> gcc/testsuite/gcc.dg/graphite/pr42729.c | 15 +
> gcc/testsuite/gcc.dg/graphite/run-id-2.c | 12 +-
> gcc/testsuite/gcc.dg/graphite/run-id-5.c | 54 ++
> gcc/testsuite/gcc.dg/graphite/run-id-6.c | 55 ++
> gcc/testsuite/gcc.dg/tree-ssa/pr20742.c | 18 +
> gcc/testsuite/gfortran.dg/graphite/id-20.f | 10 +
> gcc/testsuite/gfortran.dg/graphite/id-21.f | 20 +
> gcc/testsuite/gfortran.dg/graphite/id-22.f | 10 +
> gcc/timevar.def | 1 +
> gcc/tree-chrec.c | 62 ++-
> gcc/tree-chrec.h | 1 +
> gcc/tree-pass.h | 1 +
> gcc/tree-scalar-evolution.c | 13 +-
> gcc/tree-ssa-loop.c | 19 +
> 46 files changed, 2976 insertions(+), 1713 deletions(-)
> create mode 100644 gcc/graphite-cloog-compat.h
> create mode 100644 gcc/graphite-cloog-util.c
> create mode 100644 gcc/graphite-cloog-util.h
> create mode 100644 gcc/testsuite/gcc.dg/graphite/id-20.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/id-22.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/id-23.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/id-24.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/id-25.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/id-26.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42729.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-5.c
> create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-6.c
> create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20742.c
> create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-20.f
> create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-21.f
> create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-22.f
Sebastian provided the following clarification on those patches
posted with only ChangeLog entries...
---------------------------------------------------------------------
On Thu, Aug 05, 2010 at 12:23:42AM -0500, Sebastian Pop wrote:
> On Wed, Aug 4, 2010 at 21:20, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
> > Sebastian,
> > FYI, the patches that appear to be missing content
> > (ie are ChangeLog only) are...
> >
> > [PATCH 02/65] Fix type of integer_one_node for fold_build of POINTER_PLUS_EXPR.
> > [PATCH 03/65] Use size_one_node.
> > [PATCH 07/65] Fix comments and indentation.
> > [PATCH 08/65] Do not gather loop exit conditions on the basic blocks outside the loop.
> > [PATCH 09/65] Call compute_overall_effect_of_inner_loop from instantiate_scev_name.
> > [PATCH 10/65] Don't call pbb_to_depth_to_oldiv from compute_type_for_level.
>
> These were already committed by me to trunk after they passed the
> regression tests in the branch.
> These patches are only adding the ChangeLog.graphite entry.
>
> > [PATCH 04/65] Add analysis pass to build the refined program structure tree.
> > [PATCH 05/65] Skeleton for the new SCoP detection.
> > [PATCH 06/65] Fix refined region tree nesting.
> > [PATCH 28/65] Print bbs in refined region tree.
> > [PATCH 48/65] Dot refined regions.
> > [PATCH 50/65] Enhance region checks.
>
> These are part of the new scop detection algorithm that is still not
> complete, not stable, and only the analysis part is enabled for the
> moment in the Graphite branch. So these patches are still useless and
> make compile times a little bit slower with no benefit.
>
> > [PATCH 61/65] Adapt to new CloogScattering abstraction, introduced in official CLooG versions
> (CLOOG_ORG). (more files than in changelog)
>
> The changelog entry is not complete, I could fix this in the
> ChangeLog, but I won't change it in ChangeLog.graphite to avoid merge
> problems.
-----------------------------------------------------------------------------------
Hopefully this will clarify things and help get the
remaining graphite patches a review.
Jack
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 00/65] Merge from the Graphite branch to trunk
2010-08-03 3:07 ` Sebastian Pop
@ 2010-08-07 10:26 ` Jack Howarth
0 siblings, 0 replies; 74+ messages in thread
From: Jack Howarth @ 2010-08-07 10:26 UTC (permalink / raw)
To: Sebastian Pop; +Cc: gcc-patches, Tobias Grosser, gcc-graphite
Sebastian,
Complete testsuite results are posted at...
http://gcc.gnu.org/ml/gcc-testresults/2010-08/msg00666.html
for the graphite merge built with...
Index: opts.c
===================================================================
--- opts.c (revision 162966)
+++ opts.c (working copy)
@@ -781,6 +781,9 @@
/* -O2 optimizations. */
opt2 = (optimize >= 2);
+#ifdef HAVE_cloog
+ flag_graphite_identity = opt2;
+#endif
flag_inline_small_functions = opt2;
flag_indirect_inlining = opt2;
flag_partial_inlining = opt2;
I'll start filing PRs for these compiler ICE's from invoking -fgraphite-identity
as soon as you commit the merge to gcc trunk.
Jack
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 00/65] Merge from the Graphite branch to trunk
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
` (66 preceding siblings ...)
2010-08-05 15:58 ` Jack Howarth
@ 2010-08-11 20:54 ` Sebastian Pop
67 siblings, 0 replies; 74+ messages in thread
From: Sebastian Pop @ 2010-08-11 20:54 UTC (permalink / raw)
To: gcc-patches; +Cc: Tobias Grosser, gcc-graphite
On Mon, Aug 2, 2010 at 15:19, Sebastian Pop <sebpop@gmail.com> wrote:
> Hi,
>
> This patch-set merges the changes that went into the Graphite branch
> for the past two months. These changes are stable: the automatic
> testers passed bootstrap and CPU2006 benchmarks with no fails and with
> various Graphite flag configurations.
>
> Note that some of the patches contain only a change in
> ChangeLog.graphite, these are either already in trunk, or implement
> functionality that is not stable enough, and will remain for now in
> the branch. These changes are those linked to the new SCoP detection
> algorithm.
>
> I am testing this merge on amd64-linux. I will wait for 48 hours to
> let reviewers enough time to re-review these patches. All these
> changes have already been discussed prior to their commit to the
> Graphite branch. If there are other changes before committing to
> trunk, I will implement the needed changes.
>
Committed to trunk r163105 - r163170.
Sebastian
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 55/65] Fix tonto: call propagate_expr_outside_region.
2010-08-02 20:25 ` [PATCH 55/65] Fix tonto: call propagate_expr_outside_region Sebastian Pop
@ 2010-10-26 19:37 ` H.J. Lu
0 siblings, 0 replies; 74+ messages in thread
From: H.J. Lu @ 2010-10-26 19:37 UTC (permalink / raw)
To: Sebastian Pop; +Cc: gcc-patches, Tobias Grosser, gcc-graphite
On Mon, Aug 2, 2010 at 1:20 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
>
> 2010-07-26 Sebastian Pop <sebastian.pop@amd.com>
>
> * graphite-sese-to-poly.c (propagate_expr_outside_region): Also
> handle the case when def is in the sese region.
> (rewrite_close_phi_out_of_ssa): Call propagate_expr_outside_region
> for invariant expressions.
> (rewrite_cross_bb_phi_deps): Removed.
> (rewrite_cross_bb_scalar_deps): Also handle GIMPLE_PHI nodes.
> (rewrite_cross_bb_scalar_deps_out_of_ssa): Do not call
> rewrite_cross_bb_phi_deps.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46185
--
H.J.
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH 14/65] Also rewrite out of SSA scalar dependences going outside the SCoP region.
2010-08-02 20:22 ` [PATCH 14/65] Also rewrite out of SSA scalar dependences going outside the SCoP region Sebastian Pop
@ 2010-11-10 12:23 ` H.J. Lu
0 siblings, 0 replies; 74+ messages in thread
From: H.J. Lu @ 2010-11-10 12:23 UTC (permalink / raw)
To: Sebastian Pop; +Cc: gcc-patches, Tobias Grosser, gcc-graphite
On Mon, Aug 2, 2010 at 1:19 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
>
> 2010-06-12 Sebastian Pop <sebastian.pop@amd.com>
>
> * graphite-clast-to-gimple.c (gloog): Remove call to
> sese_adjust_liveout_phis.
> * graphite-sese-to-poly.c (scev_analyzable_p): When scev returns an
> SSA_NAME, allow it to be handled by rewrite_cross_bb_scalar_deps.
> (rewrite_cross_bb_scalar_deps): Handle GIMPLE_PHI nodes: call
> rewrite_phi_out_of_ssa.
> * sese.c (get_vdef_before_sese): Removed.
> (sese_adjust_vphi): Removed.
> (sese_adjust_liveout_phis): Removed.
> * sese.h (sese_adjust_liveout_phis): Removed.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46404
--
H.J.
^ permalink raw reply [flat|nested] 74+ messages in thread
end of thread, other threads:[~2010-11-10 12:17 UTC | newest]
Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-02 20:21 [PATCH 00/65] Merge from the Graphite branch to trunk Sebastian Pop
2010-08-02 20:21 ` [PATCH 07/65] Fix comments and indentation Sebastian Pop
2010-08-02 20:21 ` [PATCH 09/65] Call compute_overall_effect_of_inner_loop from instantiate_scev_name Sebastian Pop
2010-08-02 20:21 ` [PATCH 05/65] Skeleton for the new SCoP detection Sebastian Pop
2010-08-02 20:21 ` [PATCH 06/65] Fix refined region tree nesting Sebastian Pop
2010-08-02 20:21 ` [PATCH 03/65] Use size_one_node Sebastian Pop
2010-08-02 20:21 ` [PATCH 01/65] Fix invariant phi node removal Sebastian Pop
2010-08-02 20:21 ` [PATCH 02/65] Fix type of integer_one_node for fold_build of POINTER_PLUS_EXPR Sebastian Pop
2010-08-02 20:21 ` [PATCH 08/65] Do not gather loop exit conditions on the basic blocks outside the loop Sebastian Pop
2010-08-02 20:22 ` [PATCH 21/65] Early return in rewrite_commutative_reductions_out_of_ssa when flag_associative_math is not set Sebastian Pop
2010-08-02 20:22 ` [PATCH 10/65] Don't call pbb_to_depth_to_oldiv from compute_type_for_level Sebastian Pop
2010-08-02 20:22 ` [PATCH 17/65] Add more debug counter guards Sebastian Pop
2010-08-02 20:22 ` [PATCH 12/65] Detect commutative reductions in all the scops before rewriting out of SSA all the other scalar dependences Sebastian Pop
2010-08-02 20:22 ` [PATCH 15/65] Remove rename_nb_iterations and rename_sese_parameters Sebastian Pop
2010-08-02 20:22 ` [PATCH 04/65] Add analysis pass to build the refined program structure tree Sebastian Pop
2010-08-02 20:22 ` [PATCH 14/65] Also rewrite out of SSA scalar dependences going outside the SCoP region Sebastian Pop
2010-11-10 12:23 ` H.J. Lu
2010-08-02 20:22 ` [PATCH 18/65] Split rewrite_cross_bb_scalar_deps_out_of_ssa out from rewrite_reductions_out_of_ssa Sebastian Pop
2010-08-02 20:22 ` [PATCH 13/65] Remove insert_copyout and insert_copyin Sebastian Pop
2010-08-02 20:22 ` [PATCH 19/65] Always insert out of SSA copies on edges except for loop->latch Sebastian Pop
2010-08-02 20:22 ` [PATCH 16/65] Schedule a copy_prop pass before graphite Sebastian Pop
2010-08-02 20:23 ` [PATCH 23/65] Remove copy_renames Sebastian Pop
2010-08-02 20:23 ` [PATCH 27/65] Fix 416.gamess miscompile: special case the rewrite of degenerate phi nodes Sebastian Pop
2010-08-02 20:23 ` [PATCH 33/65] Fix flipped condition using mpz_sgn Sebastian Pop
2010-08-02 20:23 ` [PATCH 20/65] Fix testcase: call abort Sebastian Pop
2010-08-02 20:23 ` [PATCH 25/65] Remove dead code Sebastian Pop
2010-08-02 20:23 ` [PATCH 32/65] Add testcase for miscompile in gamess Sebastian Pop
2010-08-02 20:23 ` [PATCH 38/65] Remove uses of loop->single_iv Sebastian Pop
2010-08-02 20:23 ` [PATCH 37/65] Also handle GIMPLE_CALLs in rewrite_cross_bb_scalar_deps Sebastian Pop
2010-08-02 20:23 ` [PATCH 11/65] Launch dotty in background Sebastian Pop
2010-08-02 20:23 ` [PATCH 31/65] Partially removing cloog.h and graphite-clast-to-gimple.h where possible. Removing unused function check_poly_representation Sebastian Pop
2010-08-02 20:23 ` [PATCH 28/65] Print bbs in refined region tree Sebastian Pop
2010-08-02 20:23 ` [PATCH 30/65] Move cloog-related functions from graphite-ppl.{c,h} to new graphite-cloog-util.{c,h} Sebastian Pop
2010-08-02 20:23 ` [PATCH 24/65] Replace map with rename_map Sebastian Pop
2010-08-02 20:23 ` [PATCH 26/65] Fix 435.gromacs miscompile: call rewrite_close_phi_out_of_ssa from rewrite_cross_bb_phi_deps Sebastian Pop
2010-08-02 20:23 ` [PATCH 40/65] Scevs could be expressions without chrecs and still be scev_analyzable_p Sebastian Pop
2010-08-02 20:24 ` [PATCH 36/65] chrec_apply should only apply to the specified variable Sebastian Pop
2010-08-02 20:24 ` [PATCH 39/65] Bump the size of scevs Sebastian Pop
2010-08-02 20:24 ` [PATCH 43/65] Correctly handle SSA_NAME_IS_DEFAULT_DEF in rewrite_close_phi_out_of_ssa Sebastian Pop
2010-08-02 20:24 ` [PATCH 34/65] Remove insert_loop_close_phis Sebastian Pop
2010-08-02 20:24 ` [PATCH 51/65] Do not instantiate default definitions in instantiate_scev_name Sebastian Pop
2010-08-02 20:24 ` [PATCH 52/65] Use SSA_NAME_DEF_STMT only on SSA_NAMEs Sebastian Pop
2010-08-02 20:24 ` [PATCH 44/65] Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p Sebastian Pop
2010-08-02 20:24 ` [PATCH 49/65] Add loop_exits_from_bb_p Sebastian Pop
2010-08-02 20:24 ` [PATCH 35/65] Remove expand_scalar_variables_ hack Sebastian Pop
2010-08-02 20:24 ` [PATCH 48/65] Dot refined regions Sebastian Pop
2010-08-02 20:24 ` [PATCH 29/65] Resolve CLooG's value_* macros to their respective mpz_* counterparts Sebastian Pop
2010-08-02 20:24 ` [PATCH 46/65] Add testcase for PR20742 Sebastian Pop
2010-08-02 20:24 ` [PATCH 22/65] Run rewrite_cross_bb_phi_deps before rewrite_cross_bb_scalar_deps Sebastian Pop
2010-08-02 20:24 ` [PATCH 47/65] Do not translate out-of-SSA close phi nodes that can be analyzed with scev Sebastian Pop
2010-08-02 20:25 ` [PATCH 55/65] Fix tonto: call propagate_expr_outside_region Sebastian Pop
2010-10-26 19:37 ` H.J. Lu
2010-08-02 20:25 ` [PATCH 59/65] Adapt to new CLAST structure within upstream CLooG version and retain compatibility to CLooG Legacy Sebastian Pop
2010-08-02 20:25 ` [PATCH 64/65] Fix gamess: the only constant phi nodes with one argument are is_gimple_min_invariant and SSA_NAME_IS_DEFAULT_DEF Sebastian Pop
2010-08-02 20:25 ` [PATCH 61/65] Adapt to new CloogScattering abstraction, introduced in official CLooG versions (CLOOG_ORG) Sebastian Pop
2010-08-02 20:25 ` [PATCH 60/65] Introduce compatibility to newer CLooG's CloogState and mask the use with macros where possible Sebastian Pop
2010-08-02 20:25 ` [PATCH 62/65] Remove cloog_initialize and cloog_finalize when using official CLooG releases Sebastian Pop
2010-08-02 20:25 ` [PATCH 45/65] Unshare the scev before code generating it Sebastian Pop
2010-08-02 20:25 ` [PATCH 42/65] Add testcase for PR42729 and fix handling of gimple_debug info Sebastian Pop
2010-08-02 20:25 ` [PATCH 57/65] Reintroduce necessary CLooG accessors to graphite. Masked by CLOOG_ORG Sebastian Pop
2010-08-02 20:25 ` [PATCH 53/65] Propagate constant values or parametric expressions outside the scop region Sebastian Pop
2010-08-02 20:25 ` [PATCH 58/65] Make CLooG options compatible to newer CLooG releases and pass options to build_cloog_prog (CLOOG_ORG) Sebastian Pop
2010-08-02 20:25 ` [PATCH 54/65] Call scev_analyzable_p only on is_gimple_reg Sebastian Pop
2010-08-02 20:25 ` [PATCH 63/65] Fix typos Sebastian Pop
2010-08-02 20:25 ` [PATCH 56/65] Call scev_reset_htab when Graphite out-of-SSA has changed something Sebastian Pop
2010-08-02 20:25 ` [PATCH 50/65] Enhance region checks Sebastian Pop
2010-08-02 20:25 ` [PATCH 41/65] Special case non close-phi nodes with one argument in rewrite_close_phi_out_of_ssa Sebastian Pop
2010-08-02 20:25 ` [PATCH 65/65] Fix miscompile of 416.gamess Sebastian Pop
2010-08-03 2:52 ` [PATCH 00/65] Merge from the Graphite branch to trunk Jack Howarth
2010-08-03 2:55 ` Jack Howarth
2010-08-03 3:07 ` Sebastian Pop
2010-08-07 10:26 ` Jack Howarth
2010-08-05 15:58 ` Jack Howarth
2010-08-11 20:54 ` Sebastian Pop
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).