brw: fix saturate propagation region overlap range
authorOleksii Bozhenko <oleksii.bozhenko@globallogic.com>
Wed, 7 Dec 2022 17:27:45 +0000 (19:27 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 9 Dec 2022 00:39:05 +0000 (00:39 +0000)
Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/commit/947c828d5cbffe9640ac63103a6223112eeff27f
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7691

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20206>

src/intel/compiler/brw_fs_saturate_propagation.cpp

index 50c3fc1..50b05dd 100644 (file)
@@ -126,8 +126,9 @@ opt_saturate_propagation_local(const fs_live_variables &live, bblock_t *block)
          for (int i = 0; i < scan_inst->sources; i++) {
             if (scan_inst->src[i].file == VGRF &&
                 scan_inst->src[i].nr == inst->src[0].nr &&
-                scan_inst->src[i].offset / REG_SIZE ==
-                 inst->src[0].offset / REG_SIZE) {
+                regions_overlap(
+                  scan_inst->src[i], scan_inst->size_read(i),
+                  inst->src[0], inst->size_read(0))) {
                if (scan_inst->opcode != BRW_OPCODE_MOV ||
                    !scan_inst->saturate ||
                    scan_inst->src[0].abs ||