Commit a4ab23b6 by Richard Biener Committed by Richard Biener

tree-ssa-loop-im.c (determine_max_movement): Adjust cost of PHI node moving.

2014-06-17  Richard Biener  <rguenther@suse.de>

	* tree-ssa-loop-im.c (determine_max_movement): Adjust cost
	of PHI node moving.

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

From-SVN: r211724
parent 31107d5d
2014-06-17 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-im.c (determine_max_movement): Adjust cost
of PHI node moving.
2014-06-17 Kugan Vivekanandarajah <kuganv@linaro.org>
* config/arm/arm.c (arm_atomic_assign_expand_fenv): call
......
2014-06-17 Richard Biener <rguenther@suse.de>
* gcc.dg/tree-ssa/ssa-lim-12.c: New testcase.
2014-06-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/61482
......
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-lim1" } */
int a[1024];
void foo (int x, int z)
{
int i;
int y = -x;
for (i = 0; i < 1024; ++i)
a[i] = x ? y : z;
}
void bar (int x, int z)
{
int j;
for (j = 0; j < 1024; ++j)
{
int i;
int y = -j + z;
for (i = 0; i < 1024; ++i)
a[i] = x ? y : j;
}
}
/* { dg-final { scan-tree-dump-times "!= 0 ? " 2 "lim1" } } */
/* { dg-final { cleanup-tree-dump "lim1" } } */
......@@ -729,14 +729,21 @@ determine_max_movement (gimple stmt, bool must_preserve_exec)
}
if (!add_dependency (val, lim_data, loop, false))
return false;
def_data = get_lim_data (SSA_NAME_DEF_STMT (val));
if (def_data)
gimple def_stmt = SSA_NAME_DEF_STMT (val);
if (gimple_bb (def_stmt)
&& gimple_bb (def_stmt)->loop_father == loop)
{
min_cost = MIN (min_cost, def_data->cost);
total_cost += def_data->cost;
def_data = get_lim_data (def_stmt);
if (def_data)
{
min_cost = MIN (min_cost, def_data->cost);
total_cost += def_data->cost;
}
}
}
min_cost = MIN (min_cost, total_cost);
lim_data->cost += min_cost;
if (gimple_phi_num_args (stmt) > 1)
......
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