Commit 9600efe1 by Michael Matz Committed by Michael Matz

omp-low.c (optimize_omp_library_calls): Use types_compatible_p instead of…

omp-low.c (optimize_omp_library_calls): Use types_compatible_p instead of comparing TYPE_MAIN_VARIANT for equality.

        * omp-low.c (optimize_omp_library_calls): Use types_compatible_p
        instead of comparing TYPE_MAIN_VARIANT for equality.
        * tree-vect-patterns.c (vect_recog_dot_prod_pattern,
        vect_recog_widen_mult_pattern, vect_recog_widen_sum_pattern): Ditto.
        * tree-vect-loop.c (vect_is_simple_reduction): Ditto.
        * gimplify.c (goa_lhs_expr_p): Ditto and use
        STRIP_USELESS_TYPE_CONVERSION.

From-SVN: r150936
parent 10174ddf
2009-08-18 Michael Matz <matz@suse.de> 2009-08-18 Michael Matz <matz@suse.de>
* omp-low.c (optimize_omp_library_calls): Use types_compatible_p
instead of comparing TYPE_MAIN_VARIANT for equality.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern,
vect_recog_widen_mult_pattern, vect_recog_widen_sum_pattern): Ditto.
* tree-vect-loop.c (vect_is_simple_reduction): Ditto.
* gimplify.c (goa_lhs_expr_p): Ditto and use
STRIP_USELESS_TYPE_CONVERSION.
2009-08-18 Michael Matz <matz@suse.de>
* tree-ssa-structalias.c (create_variable_info_for): Also mark * tree-ssa-structalias.c (create_variable_info_for): Also mark
first field in a struct. first field in a struct.
(intra_create_variable_infos): Don't deal with flag_argument_noalias. (intra_create_variable_infos): Don't deal with flag_argument_noalias.
......
...@@ -6152,12 +6152,7 @@ goa_lhs_expr_p (tree expr, tree addr) ...@@ -6152,12 +6152,7 @@ goa_lhs_expr_p (tree expr, tree addr)
/* Also include casts to other type variants. The C front end is fond /* Also include casts to other type variants. The C front end is fond
of adding these for e.g. volatile variables. This is like of adding these for e.g. volatile variables. This is like
STRIP_TYPE_NOPS but includes the main variant lookup. */ STRIP_TYPE_NOPS but includes the main variant lookup. */
while ((CONVERT_EXPR_P (expr) STRIP_USELESS_TYPE_CONVERSION (expr);
|| TREE_CODE (expr) == NON_LVALUE_EXPR)
&& TREE_OPERAND (expr, 0) != error_mark_node
&& (TYPE_MAIN_VARIANT (TREE_TYPE (expr))
== TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (expr, 0)))))
expr = TREE_OPERAND (expr, 0);
if (TREE_CODE (expr) == INDIRECT_REF) if (TREE_CODE (expr) == INDIRECT_REF)
{ {
...@@ -6166,8 +6161,7 @@ goa_lhs_expr_p (tree expr, tree addr) ...@@ -6166,8 +6161,7 @@ goa_lhs_expr_p (tree expr, tree addr)
&& (CONVERT_EXPR_P (expr) && (CONVERT_EXPR_P (expr)
|| TREE_CODE (expr) == NON_LVALUE_EXPR) || TREE_CODE (expr) == NON_LVALUE_EXPR)
&& TREE_CODE (expr) == TREE_CODE (addr) && TREE_CODE (expr) == TREE_CODE (addr)
&& TYPE_MAIN_VARIANT (TREE_TYPE (expr)) && types_compatible_p (TREE_TYPE (expr), TREE_TYPE (addr)))
== TYPE_MAIN_VARIANT (TREE_TYPE (addr)))
{ {
expr = TREE_OPERAND (expr, 0); expr = TREE_OPERAND (expr, 0);
addr = TREE_OPERAND (addr, 0); addr = TREE_OPERAND (addr, 0);
......
...@@ -3316,8 +3316,8 @@ optimize_omp_library_calls (gimple entry_stmt) ...@@ -3316,8 +3316,8 @@ optimize_omp_library_calls (gimple entry_stmt)
continue; continue;
if (TREE_CODE (TREE_TYPE (decl)) != FUNCTION_TYPE if (TREE_CODE (TREE_TYPE (decl)) != FUNCTION_TYPE
|| TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl))) || !types_compatible_p (TREE_TYPE (TREE_TYPE (decl)),
!= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (built_in)))) TREE_TYPE (TREE_TYPE (built_in))))
continue; continue;
gimple_call_set_fndecl (call, built_in); gimple_call_set_fndecl (call, built_in);
......
...@@ -1739,13 +1739,13 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple phi, ...@@ -1739,13 +1739,13 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple phi,
type = TREE_TYPE (gimple_assign_lhs (def_stmt)); type = TREE_TYPE (gimple_assign_lhs (def_stmt));
if ((TREE_CODE (op1) == SSA_NAME if ((TREE_CODE (op1) == SSA_NAME
&& TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op1))) && !types_compatible_p (type,TREE_TYPE (op1)))
|| (TREE_CODE (op2) == SSA_NAME || (TREE_CODE (op2) == SSA_NAME
&& TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op2))) && !types_compatible_p (type, TREE_TYPE (op2)))
|| (op3 && TREE_CODE (op3) == SSA_NAME || (op3 && TREE_CODE (op3) == SSA_NAME
&& TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op3))) && !types_compatible_p (type, TREE_TYPE (op3)))
|| (op4 && TREE_CODE (op4) == SSA_NAME || (op4 && TREE_CODE (op4) == SSA_NAME
&& TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op4)))) && !types_compatible_p (type, TREE_TYPE (op4))))
{ {
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
{ {
......
...@@ -233,8 +233,8 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out) ...@@ -233,8 +233,8 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
return NULL; return NULL;
oprnd0 = gimple_assign_rhs1 (last_stmt); oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt); oprnd1 = gimple_assign_rhs2 (last_stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type) if (!types_compatible_p (TREE_TYPE (oprnd0), type)
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type)) || !types_compatible_p (TREE_TYPE (oprnd1), type))
return NULL; return NULL;
stmt = last_stmt; stmt = last_stmt;
...@@ -285,10 +285,8 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out) ...@@ -285,10 +285,8 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
oprnd0 = gimple_assign_rhs1 (stmt); oprnd0 = gimple_assign_rhs1 (stmt);
oprnd1 = gimple_assign_rhs2 (stmt); oprnd1 = gimple_assign_rhs2 (stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) if (!types_compatible_p (TREE_TYPE (oprnd0), prod_type)
!= TYPE_MAIN_VARIANT (prod_type) || !types_compatible_p (TREE_TYPE (oprnd1), prod_type))
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1))
!= TYPE_MAIN_VARIANT (prod_type))
return NULL; return NULL;
if (!widened_name_p (oprnd0, stmt, &half_type0, &def_stmt)) if (!widened_name_p (oprnd0, stmt, &half_type0, &def_stmt))
return NULL; return NULL;
...@@ -296,7 +294,7 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out) ...@@ -296,7 +294,7 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
if (!widened_name_p (oprnd1, stmt, &half_type1, &def_stmt)) if (!widened_name_p (oprnd1, stmt, &half_type1, &def_stmt))
return NULL; return NULL;
oprnd01 = gimple_assign_rhs1 (def_stmt); oprnd01 = gimple_assign_rhs1 (def_stmt);
if (TYPE_MAIN_VARIANT (half_type0) != TYPE_MAIN_VARIANT (half_type1)) if (!types_compatible_p (half_type0, half_type1))
return NULL; return NULL;
if (TYPE_PRECISION (prod_type) != TYPE_PRECISION (half_type0) * 2) if (TYPE_PRECISION (prod_type) != TYPE_PRECISION (half_type0) * 2)
return NULL; return NULL;
...@@ -384,8 +382,8 @@ vect_recog_widen_mult_pattern (gimple last_stmt, ...@@ -384,8 +382,8 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
oprnd0 = gimple_assign_rhs1 (last_stmt); oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt); oprnd1 = gimple_assign_rhs2 (last_stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type) if (!types_compatible_p (TREE_TYPE (oprnd0), type)
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type)) || !types_compatible_p (TREE_TYPE (oprnd1), type))
return NULL; return NULL;
/* Check argument 0 */ /* Check argument 0 */
...@@ -398,7 +396,7 @@ vect_recog_widen_mult_pattern (gimple last_stmt, ...@@ -398,7 +396,7 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
return NULL; return NULL;
oprnd1 = gimple_assign_rhs1 (def_stmt1); oprnd1 = gimple_assign_rhs1 (def_stmt1);
if (TYPE_MAIN_VARIANT (half_type0) != TYPE_MAIN_VARIANT (half_type1)) if (!types_compatible_p (half_type0, half_type1))
return NULL; return NULL;
/* Pattern detected. */ /* Pattern detected. */
...@@ -602,8 +600,8 @@ vect_recog_widen_sum_pattern (gimple last_stmt, tree *type_in, tree *type_out) ...@@ -602,8 +600,8 @@ vect_recog_widen_sum_pattern (gimple last_stmt, tree *type_in, tree *type_out)
oprnd0 = gimple_assign_rhs1 (last_stmt); oprnd0 = gimple_assign_rhs1 (last_stmt);
oprnd1 = gimple_assign_rhs2 (last_stmt); oprnd1 = gimple_assign_rhs2 (last_stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type) if (!types_compatible_p (TREE_TYPE (oprnd0), type)
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type)) || !types_compatible_p (TREE_TYPE (oprnd1), type))
return NULL; return NULL;
/* So far so good. Since last_stmt was detected as a (summation) reduction, /* So far so good. Since last_stmt was detected as a (summation) reduction,
......
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