i965/fs: Rearrange code to remove most of the gotos

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Ian Romanick 2018-06-13 10:11:31 -07:00
parent 77f269bb56
commit f2d8bb7a7b
1 changed files with 3 additions and 11 deletions

View File

@ -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