summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2018-06-13 10:11:31 -0700
committerIan Romanick <[email protected]>2018-06-15 17:22:27 -0700
commitf2d8bb7a7b8806c91b1ab5a186f450e0de1f5b86 (patch)
tree3b25bb81c344ca2722f7a6da2a1f4f8b63dc266b /src
parent77f269bb56037ddd723882a7ae551ef302881dff (diff)
i965/fs: Rearrange code to remove most of the gotos
Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_fs_cmod_propagation.cpp14
1 files 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 2587d62a950..b4f05613e98 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