intel/eu/validate: Don't validate regions of sends
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 29 Jan 2020 22:23:25 +0000 (16:23 -0600)
committerMarge Bot <eric+marge@anholt.net>
Fri, 31 Jan 2020 17:23:39 +0000 (17:23 +0000)
Otherwise, the validator tries to read the type of src1 of a SEND/SENDS
which doesn't actually have a type field.  This prevents validation
issues in the next commit.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3642>

src/intel/compiler/brw_eu_validate.c

index 3b802d3b35539bc0ce039252d846b6dd5fa0188b..a46ad386e78c948ccd49b6f58379e7de781fa8e2 100644 (file)
@@ -695,6 +695,9 @@ general_restrictions_based_on_operand_types(const struct gen_device_info *devinf
    unsigned exec_size = 1 << brw_inst_exec_size(devinfo, inst);
    struct string error_msg = { .str = NULL, .len = 0 };
 
+   if (inst_is_send(devinfo, inst))
+      return error_msg;
+
    if (devinfo->gen >= 11) {
       if (num_sources == 3) {
          ERROR_IF(brw_reg_type_to_size(brw_inst_3src_a1_src1_type(devinfo, inst)) == 1 ||
@@ -712,9 +715,6 @@ general_restrictions_based_on_operand_types(const struct gen_device_info *devinf
    if (num_sources == 3)
       return error_msg;
 
-   if (inst_is_send(devinfo, inst))
-      return error_msg;
-
    if (exec_size == 1)
       return error_msg;