Commit e3bdfed6 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/43934 (LIM should handle PHI nodes)

2010-05-06  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43934
	* tree-ssa-loop-im.c (movement_possibility): Handle PHI nodes.
	(stmt_cost): Likewise.
	(extract_true_false_args_from_phi): New helper.
	(determine_max_movement): For PHI nodes verify we can hoist them
	and compute their cost.
	(determine_invariantness_stmt): Handle PHI nodes.
	(move_computations_stmt): Likewise.  Hoist PHI nodes in
	if-converted form using COND_EXPRs.
	(move_computations): Return TODO_cleanup_cfg if we hoisted PHI
	nodes.
	(tree_ssa_lim): Likewise.
	* tree-flow.h (tree_ssa_lim): Adjust prototype.
	* tree-ssa-loop.c (tree_ssa_loop_im): Return todo.

	* gcc.dg/tree-ssa/ssa-lim-9.c: New testcase.

From-SVN: r159099
parent a81b065a
2010-05-06 Richard Guenther <rguenther@suse.de> 2010-05-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43934
* tree-ssa-loop-im.c (movement_possibility): Handle PHI nodes.
(stmt_cost): Likewise.
(extract_true_false_args_from_phi): New helper.
(determine_max_movement): For PHI nodes verify we can hoist them
and compute their cost.
(determine_invariantness_stmt): Handle PHI nodes.
(move_computations_stmt): Likewise. Hoist PHI nodes in
if-converted form using COND_EXPRs.
(move_computations): Return TODO_cleanup_cfg if we hoisted PHI
nodes.
(tree_ssa_lim): Likewise.
* tree-flow.h (tree_ssa_lim): Adjust prototype.
* tree-ssa-loop.c (tree_ssa_loop_im): Return todo.
2010-05-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43987 PR tree-optimization/43987
* tree-ssa-structalias.c (could_have_pointers): For possibly * tree-ssa-structalias.c (could_have_pointers): For possibly
address-taken variables force pointers to be recorded. address-taken variables force pointers to be recorded.
......
2010-05-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43934
* gcc.dg/tree-ssa/ssa-lim-9.c: New testcase.
2010-05-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43987
* gcc.c-torture/execute/pr43987.c: New testcase.
* gcc.dg/torture/pta-escape-1.c: Adjust.
* gcc.dg/tree-ssa/pta-escape-1.c: Likewise.
* gcc.dg/tree-ssa/pta-escape-2.c: Likewise.
* gcc.dg/tree-ssa/pta-escape-3.c: Likewise.
* gcc.dg/ipa/ipa-pta-11.c: Likewise.
2010-04-22 Jakub Jelinek <jakub@redhat.com> 2010-04-22 Jakub Jelinek <jakub@redhat.com>
Dodji Seketeli <dodji@redhat.com> Dodji Seketeli <dodji@redhat.com>
......
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-lim1-details" } */
void bar (int);
void foo (int n, int m)
{
unsigned i;
for (i = 0; i < n; ++i)
{
int x;
if (m < 0)
x = 1+n;
else
x = m-n;
bar (x);
}
}
/* { dg-final { scan-tree-dump-times "Moving PHI node" 1 "lim1" } } */
/* { dg-final { cleanup-tree-dump "lim1" } } */
...@@ -685,7 +685,7 @@ basic_block *blocks_in_phiopt_order (void); ...@@ -685,7 +685,7 @@ basic_block *blocks_in_phiopt_order (void);
/* In tree-ssa-loop*.c */ /* In tree-ssa-loop*.c */
void tree_ssa_lim (void); unsigned int tree_ssa_lim (void);
unsigned int tree_ssa_unswitch_loops (void); unsigned int tree_ssa_unswitch_loops (void);
unsigned int canonicalize_induction_variables (void); unsigned int canonicalize_induction_variables (void);
unsigned int tree_unroll_loops_completely (bool, bool); unsigned int tree_unroll_loops_completely (bool, bool);
......
...@@ -109,8 +109,7 @@ tree_ssa_loop_im (void) ...@@ -109,8 +109,7 @@ tree_ssa_loop_im (void)
if (number_of_loops () <= 1) if (number_of_loops () <= 1)
return 0; return 0;
tree_ssa_lim (); return tree_ssa_lim ();
return 0;
} }
static bool static bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment