Commit c7631a71 by Sebastian Pop Committed by Sebastian Pop

Fold convert SSA_NAMEs in the scalar expander.

2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>

	* sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
	Call fold_convert on all the returned values.
	(expand_scalar_variables_expr): Pass to expand_scalar_variables_ssa_name
	the type of the resulting expression.

From-SVN: r157284
parent b0602cc8
2010-03-04 Sebastian Pop <sebastian.pop@amd.com> 2010-03-04 Sebastian Pop <sebastian.pop@amd.com>
* sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
Call fold_convert on all the returned values.
(expand_scalar_variables_expr): Pass to expand_scalar_variables_ssa_name
the type of the resulting expression.
2010-03-04 Sebastian Pop <sebastian.pop@amd.com>
* graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed * graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed
ppl_min_for_le_pointset. Use ppl_Pointset_Powerset_C_Polyhedron_minimize. ppl_min_for_le_pointset. Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
* graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration. * graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration.
......
...@@ -778,7 +778,7 @@ expand_scalar_variables_call (gimple stmt, basic_block bb, sese region, ...@@ -778,7 +778,7 @@ expand_scalar_variables_call (gimple stmt, basic_block bb, sese region,
to translate the names of induction variables. */ to translate the names of induction variables. */
static tree static tree
expand_scalar_variables_ssa_name (tree op0, basic_block bb, expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
sese region, htab_t map, sese region, htab_t map,
gimple_stmt_iterator *gsi) gimple_stmt_iterator *gsi)
{ {
...@@ -787,7 +787,7 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb, ...@@ -787,7 +787,7 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb,
if (is_parameter (region, op0) if (is_parameter (region, op0)
|| is_iv (op0)) || is_iv (op0))
return get_rename (map, op0); return fold_convert (type, get_rename (map, op0));
def_stmt = SSA_NAME_DEF_STMT (op0); def_stmt = SSA_NAME_DEF_STMT (op0);
...@@ -796,7 +796,7 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb, ...@@ -796,7 +796,7 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb,
if (new_op != op0 if (new_op != op0
&& gimple_bb (SSA_NAME_DEF_STMT (new_op)) == bb) && gimple_bb (SSA_NAME_DEF_STMT (new_op)) == bb)
return new_op; return fold_convert (type, new_op);
if (gimple_bb (def_stmt) == bb) if (gimple_bb (def_stmt) == bb)
{ {
...@@ -804,13 +804,13 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb, ...@@ -804,13 +804,13 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb,
we do not need to create a new expression for it, we we do not need to create a new expression for it, we
only need to ensure its operands are expanded. */ 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, map, gsi);
return new_op; return fold_convert (type, new_op);
} }
else else
{ {
if (!gimple_bb (def_stmt) if (!gimple_bb (def_stmt)
|| !bb_in_sese_p (gimple_bb (def_stmt), region)) || !bb_in_sese_p (gimple_bb (def_stmt), region))
return new_op; return fold_convert (type, new_op);
switch (gimple_code (def_stmt)) switch (gimple_code (def_stmt))
{ {
...@@ -871,7 +871,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code, ...@@ -871,7 +871,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
{ {
tree old_name = TREE_OPERAND (op0, 0); tree old_name = TREE_OPERAND (op0, 0);
tree expr = expand_scalar_variables_ssa_name tree expr = expand_scalar_variables_ssa_name
(old_name, bb, region, map, gsi); (type, old_name, bb, region, map, gsi);
if (TREE_CODE (expr) != SSA_NAME if (TREE_CODE (expr) != SSA_NAME
&& is_gimple_reg (old_name)) && is_gimple_reg (old_name))
...@@ -938,7 +938,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code, ...@@ -938,7 +938,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
} }
if (code == SSA_NAME) if (code == SSA_NAME)
return expand_scalar_variables_ssa_name (op0, bb, region, map, gsi); return expand_scalar_variables_ssa_name (type, op0, bb, region, map, gsi);
if (code == ADDR_EXPR) if (code == ADDR_EXPR)
{ {
......
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