Commit 51c0074e by Jan Sjodin Committed by Sebastian Pop

lambda-code.c (remove_iv): New.

	* lambda-code.c (remove_iv): New.
	(lambda_loopnest_to_gcc_loopnest): Use remove_iv.


Co-Authored-By: Sebastian Pop <sebpop@gmail.com>

From-SVN: r125605
parent 79f5e442
2007-06-10 Jan Sjodin <jan.sjodin@amd.com>
Sebastian Pop <sebpop@gmail.com>
* lambda-code.c (remove_iv): New.
(lambda_loopnest_to_gcc_loopnest): Use remove_iv.
2007-06-10 Zdenek Dvorak <dvorakz@suse.cz> 2007-06-10 Zdenek Dvorak <dvorakz@suse.cz>
* tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL. * tree-data-ref.c (dr_analyze_alias): Handle case smt is NULL.
......
...@@ -1616,6 +1616,45 @@ lle_to_gcc_expression (lambda_linear_expression lle, ...@@ -1616,6 +1616,45 @@ lle_to_gcc_expression (lambda_linear_expression lle,
return force_gimple_operand (fold (expr), stmts_to_insert, true, resvar); return force_gimple_operand (fold (expr), stmts_to_insert, true, resvar);
} }
/* Remove the induction variable defined at IV_STMT. */
static void
remove_iv (tree iv_stmt)
{
if (TREE_CODE (iv_stmt) == PHI_NODE)
{
int i;
for (i = 0; i < PHI_NUM_ARGS (iv_stmt); i++)
{
tree stmt;
imm_use_iterator imm_iter;
tree arg = PHI_ARG_DEF (iv_stmt, i);
bool used = false;
if (TREE_CODE (arg) != SSA_NAME)
continue;
FOR_EACH_IMM_USE_STMT (stmt, imm_iter, arg)
if (stmt != iv_stmt)
used = true;
if (!used)
remove_iv (SSA_NAME_DEF_STMT (arg));
}
remove_phi_node (iv_stmt, NULL_TREE, true);
}
else
{
block_stmt_iterator bsi = bsi_for_stmt (iv_stmt);
bsi_remove (&bsi, true);
release_defs (iv_stmt);
}
}
/* Transform a lambda loopnest NEW_LOOPNEST, which had TRANSFORM applied to /* Transform a lambda loopnest NEW_LOOPNEST, which had TRANSFORM applied to
it, back into gcc code. This changes the it, back into gcc code. This changes the
loops, their induction variables, and their bodies, so that they loops, their induction variables, and their bodies, so that they
...@@ -1797,6 +1836,9 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, ...@@ -1797,6 +1836,9 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
propagate_value (use_p, newiv); propagate_value (use_p, newiv);
update_stmt (stmt); update_stmt (stmt);
} }
/* Remove the now unused induction variable. */
remove_iv (oldiv_stmt);
} }
VEC_free (tree, heap, new_ivs); VEC_free (tree, heap, new_ivs);
} }
......
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