re PR tree-optimization/42027 (Performance regression in convolution loop optimization)

PR tree-optimization/42027
	* cfgexpand.c (expand_gimple_cond): Use jumpy sequence for &, &&, |
	and || if jumps are cheap.

From-SVN: r155367
This commit is contained in:
Michael Matz 2009-12-20 01:15:46 +00:00 committed by Michael Matz
parent e72297c572
commit e83f4b68e7
2 changed files with 34 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2009-12-20 Michael Matz <matz@suse.de>
PR tree-optimization/42027
* cfgexpand.c (expand_gimple_cond): Use jumpy sequence for &, &&, |
and || if jumps are cheap.
2009-12-19 Richard Guenther <rguenther@suse.de>
PR lto/42401

View File

@ -1606,14 +1606,36 @@ expand_gimple_cond (basic_block bb, gimple stmt)
&& bitmap_bit_p (SA.values, SSA_NAME_VERSION (op0)))
{
gimple second = SSA_NAME_DEF_STMT (op0);
if (gimple_code (second) == GIMPLE_ASSIGN
&& TREE_CODE_CLASS (gimple_assign_rhs_code (second))
== tcc_comparison)
if (gimple_code (second) == GIMPLE_ASSIGN)
{
code = gimple_assign_rhs_code (second);
enum tree_code code2 = gimple_assign_rhs_code (second);
if (TREE_CODE_CLASS (code2) == tcc_comparison)
{
code = code2;
op0 = gimple_assign_rhs1 (second);
op1 = gimple_assign_rhs2 (second);
}
/* If jumps are cheap turn some more codes into
jumpy sequences. */
else if (BRANCH_COST (optimize_insn_for_speed_p (), false) < 4)
{
if ((code2 == BIT_AND_EXPR
&& TYPE_PRECISION (TREE_TYPE (op0)) == 1
&& TREE_CODE (gimple_assign_rhs2 (second)) != INTEGER_CST)
|| code2 == TRUTH_AND_EXPR)
{
code = TRUTH_ANDIF_EXPR;
op0 = gimple_assign_rhs1 (second);
op1 = gimple_assign_rhs2 (second);
}
else if (code2 == BIT_IOR_EXPR || code2 == TRUTH_OR_EXPR)
{
code = TRUTH_ORIF_EXPR;
op0 = gimple_assign_rhs1 (second);
op1 = gimple_assign_rhs2 (second);
}
}
}
}
last2 = last = get_last_insn ();