Mesa (main): intel/fs: Remove redundant inst->opcode checks in cmod prop

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 30 21:11:44 UTC 2021


Module: Mesa
Branch: main
Commit: 4f6c5da02516553150911cf2049d25a80f45c9df
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f6c5da02516553150911cf2049d25a80f45c9df

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Jul 20 18:31:22 2021 -0700

intel/fs: Remove redundant inst->opcode checks in cmod prop

This foreach_inst_in_block_reverse_starting_from loop only applies
CMP, MOV, and AND.  AND instructions break out of the loop before this
point.

Reviewed-by: Marcin Ślusarz <marcin.slusarz at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12045>

---

 src/intel/compiler/brw_fs_cmod_propagation.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp
index 770e417e47f..c3c59dc1b05 100644
--- a/src/intel/compiler/brw_fs_cmod_propagation.cpp
+++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp
@@ -488,9 +488,8 @@ opt_cmod_propagation_local(const intel_device_info *devinfo, bblock_t *block)
                    cond != BRW_CONDITIONAL_G)
                   break;
 
-               if (inst->opcode != BRW_OPCODE_MOV &&
-                   inst->opcode != BRW_OPCODE_CMP)
-                  break;
+               assert(inst->opcode == BRW_OPCODE_MOV ||
+                      inst->opcode == BRW_OPCODE_CMP);
 
                /* inst->src[1].is_zero() was tested before, but be safe
                 * against possible future changes in this code.



More information about the mesa-commit mailing list