intel/compiler: Limit scope of cur_endif variable

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25216>
This commit is contained in:
Ian Romanick 2023-09-11 11:10:30 -07:00 committed by Marge Bot
parent 02f9bbf6f3
commit 5842829380

View file

@ -180,7 +180,6 @@ cfg_t::cfg_t(const backend_shader *s, exec_list *instructions) :
bblock_t *entry = new_block();
bblock_t *cur_if = NULL; /**< BB ending with IF. */
bblock_t *cur_else = NULL; /**< BB ending with ELSE. */
bblock_t *cur_endif = NULL; /**< BB starting with ENDIF. */
bblock_t *cur_do = NULL; /**< BB starting with DO. */
bblock_t *cur_while = NULL; /**< BB immediately following WHILE. */
exec_list if_stack, else_stack, do_stack, while_stack;
@ -206,7 +205,6 @@ cfg_t::cfg_t(const backend_shader *s, exec_list *instructions) :
cur_if = cur;
cur_else = NULL;
cur_endif = NULL;
/* Set up our immediately following block, full of "then"
* instructions.
@ -231,6 +229,8 @@ cfg_t::cfg_t(const backend_shader *s, exec_list *instructions) :
break;
case BRW_OPCODE_ENDIF: {
bblock_t *cur_endif;
if (cur->instructions.is_empty()) {
/* New block was just created; use it. */
cur_endif = cur;