From 4f6c5da02516553150911cf2049d25a80f45c9df Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 20 Jul 2021 18:31:22 -0700 Subject: [PATCH] intel/fs: Remove redundant inst->opcode checks in cmod prop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Part-of: --- 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 770e417..c3c59dc 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. -- 2.7.4