tree-ssa-sccvn.c (vn_get_expr_for): Handle CONSTRUCTOR of vector type.
2011-10-05 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.c (vn_get_expr_for): Handle CONSTRUCTOR of vector type. (simplify_unary_expression): Handle BIT_FIELD_REFs. (try_to_simplify): Handle BIT_FIELD_REFs. From-SVN: r179549
This commit is contained in:
parent
4c4973ab36
commit
18474649d9
|
@ -1,3 +1,10 @@
|
||||||
|
2011-10-05 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
* tree-ssa-sccvn.c (vn_get_expr_for): Handle CONSTRUCTOR of
|
||||||
|
vector type.
|
||||||
|
(simplify_unary_expression): Handle BIT_FIELD_REFs.
|
||||||
|
(try_to_simplify): Handle BIT_FIELD_REFs.
|
||||||
|
|
||||||
2011-10-05 Georg-Johann Lay <avr@gjlay.de>
|
2011-10-05 Georg-Johann Lay <avr@gjlay.de>
|
||||||
|
|
||||||
* config/avr/avr-protos.h (avr_out_addto_sp): New prototype.
|
* config/avr/avr-protos.h (avr_out_addto_sp): New prototype.
|
||||||
|
|
|
@ -275,6 +275,13 @@ vn_get_expr_for (tree name)
|
||||||
gimple_assign_rhs2 (def_stmt));
|
gimple_assign_rhs2 (def_stmt));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case tcc_exceptional:
|
||||||
|
if (code == CONSTRUCTOR
|
||||||
|
&& TREE_CODE
|
||||||
|
(TREE_TYPE (gimple_assign_rhs1 (def_stmt))) == VECTOR_TYPE)
|
||||||
|
expr = gimple_assign_rhs1 (def_stmt);
|
||||||
|
break;
|
||||||
|
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
if (expr == NULL_TREE)
|
if (expr == NULL_TREE)
|
||||||
|
@ -2922,7 +2929,8 @@ simplify_unary_expression (gimple stmt)
|
||||||
GIMPLE_ASSIGN_SINGLE codes. */
|
GIMPLE_ASSIGN_SINGLE codes. */
|
||||||
if (code == REALPART_EXPR
|
if (code == REALPART_EXPR
|
||||||
|| code == IMAGPART_EXPR
|
|| code == IMAGPART_EXPR
|
||||||
|| code == VIEW_CONVERT_EXPR)
|
|| code == VIEW_CONVERT_EXPR
|
||||||
|
|| code == BIT_FIELD_REF)
|
||||||
op0 = TREE_OPERAND (op0, 0);
|
op0 = TREE_OPERAND (op0, 0);
|
||||||
|
|
||||||
if (TREE_CODE (op0) != SSA_NAME)
|
if (TREE_CODE (op0) != SSA_NAME)
|
||||||
|
@ -2934,7 +2942,8 @@ simplify_unary_expression (gimple stmt)
|
||||||
else if (CONVERT_EXPR_CODE_P (code)
|
else if (CONVERT_EXPR_CODE_P (code)
|
||||||
|| code == REALPART_EXPR
|
|| code == REALPART_EXPR
|
||||||
|| code == IMAGPART_EXPR
|
|| code == IMAGPART_EXPR
|
||||||
|| code == VIEW_CONVERT_EXPR)
|
|| code == VIEW_CONVERT_EXPR
|
||||||
|
|| code == BIT_FIELD_REF)
|
||||||
{
|
{
|
||||||
/* We want to do tree-combining on conversion-like expressions.
|
/* We want to do tree-combining on conversion-like expressions.
|
||||||
Make sure we feed only SSA_NAMEs or constants to fold though. */
|
Make sure we feed only SSA_NAMEs or constants to fold though. */
|
||||||
|
@ -2943,6 +2952,7 @@ simplify_unary_expression (gimple stmt)
|
||||||
|| BINARY_CLASS_P (tem)
|
|| BINARY_CLASS_P (tem)
|
||||||
|| TREE_CODE (tem) == VIEW_CONVERT_EXPR
|
|| TREE_CODE (tem) == VIEW_CONVERT_EXPR
|
||||||
|| TREE_CODE (tem) == SSA_NAME
|
|| TREE_CODE (tem) == SSA_NAME
|
||||||
|
|| TREE_CODE (tem) == CONSTRUCTOR
|
||||||
|| is_gimple_min_invariant (tem))
|
|| is_gimple_min_invariant (tem))
|
||||||
op0 = tem;
|
op0 = tem;
|
||||||
}
|
}
|
||||||
|
@ -2951,7 +2961,14 @@ simplify_unary_expression (gimple stmt)
|
||||||
if (op0 == orig_op0)
|
if (op0 == orig_op0)
|
||||||
return NULL_TREE;
|
return NULL_TREE;
|
||||||
|
|
||||||
result = fold_unary_ignore_overflow (code, gimple_expr_type (stmt), op0);
|
if (code == BIT_FIELD_REF)
|
||||||
|
{
|
||||||
|
tree rhs = gimple_assign_rhs1 (stmt);
|
||||||
|
result = fold_ternary (BIT_FIELD_REF, TREE_TYPE (rhs),
|
||||||
|
op0, TREE_OPERAND (rhs, 1), TREE_OPERAND (rhs, 2));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result = fold_unary_ignore_overflow (code, gimple_expr_type (stmt), op0);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
STRIP_USELESS_TYPE_CONVERSION (result);
|
STRIP_USELESS_TYPE_CONVERSION (result);
|
||||||
|
@ -2989,7 +3006,8 @@ try_to_simplify (gimple stmt)
|
||||||
/* Fallthrough for some unary codes that can operate on registers. */
|
/* Fallthrough for some unary codes that can operate on registers. */
|
||||||
if (!(code == REALPART_EXPR
|
if (!(code == REALPART_EXPR
|
||||||
|| code == IMAGPART_EXPR
|
|| code == IMAGPART_EXPR
|
||||||
|| code == VIEW_CONVERT_EXPR))
|
|| code == VIEW_CONVERT_EXPR
|
||||||
|
|| code == BIT_FIELD_REF))
|
||||||
break;
|
break;
|
||||||
/* We could do a little more with unary ops, if they expand
|
/* We could do a little more with unary ops, if they expand
|
||||||
into binary ops, but it's debatable whether it is worth it. */
|
into binary ops, but it's debatable whether it is worth it. */
|
||||||
|
@ -3159,7 +3177,8 @@ visit_use (tree use)
|
||||||
/* VOP-less references can go through unary case. */
|
/* VOP-less references can go through unary case. */
|
||||||
if ((code == REALPART_EXPR
|
if ((code == REALPART_EXPR
|
||||||
|| code == IMAGPART_EXPR
|
|| code == IMAGPART_EXPR
|
||||||
|| code == VIEW_CONVERT_EXPR)
|
|| code == VIEW_CONVERT_EXPR
|
||||||
|
|| code == BIT_FIELD_REF)
|
||||||
&& TREE_CODE (TREE_OPERAND (rhs1, 0)) == SSA_NAME)
|
&& TREE_CODE (TREE_OPERAND (rhs1, 0)) == SSA_NAME)
|
||||||
{
|
{
|
||||||
changed = visit_nary_op (lhs, stmt);
|
changed = visit_nary_op (lhs, stmt);
|
||||||
|
|
Loading…
Reference in New Issue