Mesa (staging/21.2): intel/compiler: Update block IPs once in opt_cmod_propagation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 14 17:27:03 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 3cb203303c33b9953dfe12c25d295535c336c78a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3cb203303c33b9953dfe12c25d295535c336c78a

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Mon Jun 28 20:53:22 2021 -0700

intel/compiler: Update block IPs once in opt_cmod_propagation

No difference proven at 95.0% confidence (n=10) in
dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13.

v2: Only update each block's IP data once instead of once per block.
Suggested by Emma.

Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>

---

 src/intel/compiler/brw_fs_cmod_propagation.cpp | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp
index 63e25d3bafe..435186c1de1 100644
--- a/src/intel/compiler/brw_fs_cmod_propagation.cpp
+++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp
@@ -135,7 +135,7 @@ cmod_propagate_cmp_to_add(const intel_device_info *devinfo, bblock_t *block,
              ((!read_flag && scan_inst->conditional_mod == BRW_CONDITIONAL_NONE) ||
               scan_inst->conditional_mod == cond)) {
             scan_inst->conditional_mod = cond;
-            inst->remove(block);
+            inst->remove(block, true);
             return true;
          }
          break;
@@ -203,7 +203,7 @@ cmod_propagate_not(const intel_device_info *devinfo, bblock_t *block,
              ((!read_flag && scan_inst->conditional_mod == BRW_CONDITIONAL_NONE) ||
               scan_inst->conditional_mod == cond)) {
             scan_inst->conditional_mod = cond;
-            inst->remove(block);
+            inst->remove(block, true);
             return true;
          }
          break;
@@ -309,7 +309,7 @@ opt_cmod_propagation_local(const intel_device_info *devinfo, bblock_t *block)
             if (inst->conditional_mod == BRW_CONDITIONAL_NZ &&
                 scan_inst->opcode == BRW_OPCODE_CMP &&
                 brw_reg_type_is_integer(inst->dst.type)) {
-               inst->remove(block);
+               inst->remove(block, true);
                progress = true;
                break;
             }
@@ -403,17 +403,17 @@ opt_cmod_propagation_local(const intel_device_info *devinfo, bblock_t *block)
                        inst->src[0].type == BRW_REGISTER_TYPE_UD) ||
                       (inst->conditional_mod == BRW_CONDITIONAL_L &&
                        inst->src[0].type == BRW_REGISTER_TYPE_D)) {
-                     inst->remove(block);
+                     inst->remove(block, true);
                      progress = true;
                      break;
                   }
                } else if (scan_inst->conditional_mod == inst->conditional_mod) {
-                  inst->remove(block);
+                  inst->remove(block, true);
                   progress = true;
                   break;
                } else if (!read_flag) {
                   scan_inst->conditional_mod = inst->conditional_mod;
-                  inst->remove(block);
+                  inst->remove(block, true);
                   progress = true;
                   break;
                }
@@ -499,7 +499,7 @@ opt_cmod_propagation_local(const intel_device_info *devinfo, bblock_t *block)
                  scan_inst->conditional_mod == cond)) {
                scan_inst->conditional_mod = cond;
                scan_inst->flag_subreg = inst->flag_subreg;
-               inst->remove(block);
+               inst->remove(block, true);
                progress = true;
             }
             break;
@@ -513,6 +513,9 @@ opt_cmod_propagation_local(const intel_device_info *devinfo, bblock_t *block)
       }
    }
 
+   /* There is progress if and only if instructions were removed. */
+   assert(progress == (block->end_ip_delta != 0));
+
    return progress;
 }
 
@@ -525,8 +528,11 @@ fs_visitor::opt_cmod_propagation()
       progress = opt_cmod_propagation_local(devinfo, block) || progress;
    }
 
-   if (progress)
+   if (progress) {
+      cfg->adjust_block_ips();
+
       invalidate_analysis(DEPENDENCY_INSTRUCTIONS);
+   }
 
    return progress;
 }



More information about the mesa-commit mailing list