Commit e0db1402 by Bin Cheng Committed by Bin Cheng

tree-ssa-loop-ivopts.c (get_computation_cost_at): Don't clobber cbase.

	* tree-ssa-loop-ivopts.c (get_computation_cost_at): Don't clobber
	cbase.

From-SVN: r235805
parent fb2647aa
2016-05-03 Bin Cheng <bin.cheng@arm.com>
* tree-ssa-loop-ivopts.c (get_computation_cost_at): Don't clobber
cbase.
2016-05-03 Oleg Endo <olegendo@gcc.gnu.org> 2016-05-03 Oleg Endo <olegendo@gcc.gnu.org>
* config/sh/sh.md (udivsi3, divsi3, mulsi3): Simplify. * config/sh/sh.md (udivsi3, divsi3, mulsi3): Simplify.
......
...@@ -4814,17 +4814,19 @@ get_computation_cost_at (struct ivopts_data *data, ...@@ -4814,17 +4814,19 @@ get_computation_cost_at (struct ivopts_data *data,
(ratio, mem_mode, (ratio, mem_mode,
TYPE_ADDR_SPACE (TREE_TYPE (utype)))) TYPE_ADDR_SPACE (TREE_TYPE (utype))))
{ {
tree real_cbase = cbase;
if (cstepi == 0 && stmt_is_after_inc) if (cstepi == 0 && stmt_is_after_inc)
{ {
if (POINTER_TYPE_P (ctype)) if (POINTER_TYPE_P (ctype))
cbase = fold_build2 (POINTER_PLUS_EXPR, ctype, cbase, cstep); real_cbase = fold_build2 (POINTER_PLUS_EXPR, ctype, cbase, cstep);
else else
cbase = fold_build2 (PLUS_EXPR, ctype, cbase, cstep); real_cbase = fold_build2 (PLUS_EXPR, ctype, cbase, cstep);
} }
cbase real_cbase = fold_build2 (MULT_EXPR, ctype, real_cbase,
= fold_build2 (MULT_EXPR, ctype, cbase, build_int_cst (ctype, ratio)); build_int_cst (ctype, ratio));
cost = difference_cost (data, cost = difference_cost (data,
ubase, cbase, ubase, real_cbase,
&symbol_present, &var_present, &offset, &symbol_present, &var_present, &offset,
depends_on); depends_on);
cost.cost /= avg_loop_niter (data->current_loop); cost.cost /= avg_loop_niter (data->current_loop);
......
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