]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
omp-low.c (optimize_omp_library_calls): Use types_compatible_p instead of comparing...
authorMichael Matz <matz@suse.de>
Wed, 19 Aug 2009 14:29:52 +0000 (14:29 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Wed, 19 Aug 2009 14:29:52 +0000 (14:29 +0000)
        * 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

gcc/ChangeLog
gcc/gimplify.c
gcc/omp-low.c
gcc/tree-vect-loop.c
gcc/tree-vect-patterns.c

index 9df0297b0c63ce63c0047a93a5c1cb47660fa3af..855e4e50926041e070c90107c4cc08d16935e9d6 100644 (file)
@@ -1,3 +1,13 @@
+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
index 7de2a7e183f2a9f0f3a5b8fe64a4cc1ae81ed2c5..3ba40a88f19b19a3257765dabdaeec1ec81566ed 100644 (file)
@@ -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
      of adding these for e.g. volatile variables.  This is like 
      STRIP_TYPE_NOPS but includes the main variant lookup.  */
-  while ((CONVERT_EXPR_P (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);
+  STRIP_USELESS_TYPE_CONVERSION (expr);
 
   if (TREE_CODE (expr) == INDIRECT_REF)
     {
@@ -6166,8 +6161,7 @@ goa_lhs_expr_p (tree expr, tree addr)
             && (CONVERT_EXPR_P (expr)
                 || TREE_CODE (expr) == NON_LVALUE_EXPR)
             && TREE_CODE (expr) == TREE_CODE (addr)
-            && TYPE_MAIN_VARIANT (TREE_TYPE (expr))
-               == TYPE_MAIN_VARIANT (TREE_TYPE (addr)))
+            && types_compatible_p (TREE_TYPE (expr), TREE_TYPE (addr)))
        {
          expr = TREE_OPERAND (expr, 0);
          addr = TREE_OPERAND (addr, 0);
index 087f6fc42f4cd0e2d3244709631ac08e56d43771..a7de367e43285ba7ddb78404df7f261c76c5fee0 100644 (file)
@@ -3316,8 +3316,8 @@ optimize_omp_library_calls (gimple entry_stmt)
              continue;
 
            if (TREE_CODE (TREE_TYPE (decl)) != FUNCTION_TYPE
-               || TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl)))
-                  != TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (built_in))))
+               || !types_compatible_p (TREE_TYPE (TREE_TYPE (decl)),
+                                       TREE_TYPE (TREE_TYPE (built_in))))
              continue;
 
            gimple_call_set_fndecl (call, built_in);
index b322213f10867ed135ce59dc19fd068f29e69a22..83833b137fa7d058be8cfd9584c807738adebd36 100644 (file)
@@ -1739,13 +1739,13 @@ vect_is_simple_reduction (loop_vec_info loop_info, gimple phi,
 
   type = TREE_TYPE (gimple_assign_lhs (def_stmt));
   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
-          && TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op2)))
+          && !types_compatible_p (type, TREE_TYPE (op2)))
       || (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
-          && TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op4))))
+          && !types_compatible_p (type, TREE_TYPE (op4))))
     {
       if (vect_print_dump_info (REPORT_DETAILS))
         {
index 1971e6ad4d3a0ece2e6035cc68f84521932a7b14..3a77e858a57739a75596184323566e8a66de00fc 100644 (file)
@@ -233,8 +233,8 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
         return NULL;
       oprnd0 = gimple_assign_rhs1 (last_stmt);
       oprnd1 = gimple_assign_rhs2 (last_stmt);
-      if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type)
-          || TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type))
+      if (!types_compatible_p (TREE_TYPE (oprnd0), type)
+         || !types_compatible_p (TREE_TYPE (oprnd1), type))
         return NULL;
       stmt = last_stmt;
 
@@ -285,10 +285,8 @@ vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
 
       oprnd0 = gimple_assign_rhs1 (stmt);
       oprnd1 = gimple_assign_rhs2 (stmt);
-      if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) 
-                               != TYPE_MAIN_VARIANT (prod_type)
-          || TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) 
-                               != TYPE_MAIN_VARIANT (prod_type))
+      if (!types_compatible_p (TREE_TYPE (oprnd0), prod_type)
+          || !types_compatible_p (TREE_TYPE (oprnd1), prod_type))
         return NULL;
       if (!widened_name_p (oprnd0, stmt, &half_type0, &def_stmt))
         return NULL;
@@ -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))
         return NULL;
       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;
       if (TYPE_PRECISION (prod_type) != TYPE_PRECISION (half_type0) * 2)
        return NULL;
@@ -384,8 +382,8 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
 
   oprnd0 = gimple_assign_rhs1 (last_stmt);
   oprnd1 = gimple_assign_rhs2 (last_stmt);
-  if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type)
-      || TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type))
+  if (!types_compatible_p (TREE_TYPE (oprnd0), type)
+      || !types_compatible_p (TREE_TYPE (oprnd1), type))
     return NULL;
 
   /* Check argument 0 */
@@ -398,7 +396,7 @@ vect_recog_widen_mult_pattern (gimple last_stmt,
     return NULL;
   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;
 
   /* Pattern detected.  */
@@ -602,8 +600,8 @@ vect_recog_widen_sum_pattern (gimple last_stmt, tree *type_in, tree *type_out)
 
   oprnd0 = gimple_assign_rhs1 (last_stmt);
   oprnd1 = gimple_assign_rhs2 (last_stmt);
-  if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type)
-      || TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type))
+  if (!types_compatible_p (TREE_TYPE (oprnd0), type)
+      || !types_compatible_p (TREE_TYPE (oprnd1), type))
     return NULL;
 
   /* So far so good. Since last_stmt was detected as a (summation) reduction,