intel/fs: Remove redundant inst->opcode checks in cmod prop
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 21 Jul 2021 01:31:22 +0000 (18:31 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 30 Aug 2021 21:00:14 +0000 (14:00 -0700)
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@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12045>

src/intel/compiler/brw_fs_cmod_propagation.cpp

index 770e417..c3c59dc 100644 (file)
@@ -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.