From f2d8bb7a7b8806c91b1ab5a186f450e0de1f5b86 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 13 Jun 2018 10:11:31 -0700 Subject: [PATCH] i965/fs: Rearrange code to remove most of the gotos Signed-off-by: Ian Romanick --- src/intel/compiler/brw_fs_cmod_propagation.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/intel/compiler/brw_fs_cmod_propagation.cpp b/src/intel/compiler/brw_fs_cmod_propagation.cpp index 2587d62..b4f0561 100644 --- a/src/intel/compiler/brw_fs_cmod_propagation.cpp +++ b/src/intel/compiler/brw_fs_cmod_propagation.cpp @@ -55,15 +55,11 @@ cmod_propagate_cmp_to_add(const gen_device_info *devinfo, bblock_t *block, bool read_flag = false; foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst) { - /* The extra scope is to prevent compiler errors for gotos crossing a - * variable initializer (cond, below). - */ - { + if (scan_inst->opcode == BRW_OPCODE_ADD && + !scan_inst->is_partial_write() && + scan_inst->exec_size == inst->exec_size) { bool negate; - if (scan_inst->opcode != BRW_OPCODE_ADD) - goto not_match; - /* A CMP is basically a subtraction. The result of the * subtraction must be the same as the result of the addition. * This means that one of the operands must be negated. So (a + @@ -83,10 +79,6 @@ cmod_propagate_cmp_to_add(const gen_device_info *devinfo, bblock_t *block, goto not_match; } - if (scan_inst->is_partial_write() || - scan_inst->exec_size != inst->exec_size) - goto not_match; - /* From the Sky Lake PRM Vol. 7 "Assigning Conditional Mods": * * * Note that the [post condition signal] bits generated at -- 2.7.4