More vect_get_and_check_slp_defs refactoring
authorRichard Biener <rguenther@suse.de>
Wed, 14 Oct 2020 13:04:24 +0000 (15:04 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 14 Oct 2020 14:27:03 +0000 (16:27 +0200)
This is another tiny piece in some bigger refactoring of
vect_get_and_check_slp_defs.  Split out a test that has nothing
to do with def types or commutation.

2020-10-14  Richard Biener  <rguenther@suse.de>

* tree-vect-slp.c (vect_get_and_check_slp_defs): Split out
test for compatible operand types.

gcc/tree-vect-slp.c

index ba681fe6d5e83ab52bd4d70963b62ce48f7c796d..5e0a360894889d18238eb8f258a24643e2931105 100644 (file)
@@ -486,6 +486,14 @@ again:
        }
       else
        {
+         if (!types_compatible_p (oprnd_info->first_op_type, type))
+           {
+             if (dump_enabled_p ())
+               dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+                                "Build SLP failed: different operand types\n");
+             return 1;
+           }
+
          /* Not first stmt of the group, check that the def-stmt/s match
             the def-stmt/s of the first stmt.  Allow different definition
             types for reduction chains: the first stmt must be a
@@ -503,7 +511,6 @@ again:
                     || oprnd_info->first_dt == vect_constant_def)
                    && (dt == vect_external_def
                        || dt == vect_constant_def)))
-             || !types_compatible_p (oprnd_info->first_op_type, type)
              || (!STMT_VINFO_DATA_REF (stmt_info)
                  && REDUC_GROUP_FIRST_ELEMENT (stmt_info)
                  && ((!def_stmt_info