From ed4e1beceadc5efecfd5af6e140a6f0b94b157ec Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 13 Jun 2023 16:14:50 -0700 Subject: [PATCH] intel/fs: Move defin/defout setup to the start of the loop. Refactor for the next commit. Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs_live_variables.cpp | 46 ++++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/intel/compiler/brw_fs_live_variables.cpp b/src/intel/compiler/brw_fs_live_variables.cpp index d6731d77a80..fa74fc2cccd 100644 --- a/src/intel/compiler/brw_fs_live_variables.cpp +++ b/src/intel/compiler/brw_fs_live_variables.cpp @@ -156,7 +156,29 @@ fs_live_variables::compute_live_variables() { bool cont = true; - while (cont) { + /* Propagate defin and defout down the CFG to calculate the union of live + * variables potentially defined along any possible control flow path. + */ + do { + cont = false; + + foreach_block (block, cfg) { + const struct block_data *bd = &block_data[block->num]; + + foreach_list_typed(bblock_link, child_link, link, &block->children) { + struct block_data *child_bd = &block_data[child_link->block->num]; + + for (int i = 0; i < bitset_words; i++) { + const BITSET_WORD new_def = bd->defout[i] & ~child_bd->defin[i]; + child_bd->defin[i] |= new_def; + child_bd->defout[i] |= new_def; + cont |= new_def; + } + } + } + } while (cont); + + do { cont = false; foreach_block_reverse (block, cfg) { @@ -200,28 +222,6 @@ fs_live_variables::compute_live_variables() cont = true; } } - } - - /* Propagate defin and defout down the CFG to calculate the union of live - * variables potentially defined along any possible control flow path. - */ - do { - cont = false; - - foreach_block (block, cfg) { - const struct block_data *bd = &block_data[block->num]; - - foreach_list_typed(bblock_link, child_link, link, &block->children) { - struct block_data *child_bd = &block_data[child_link->block->num]; - - for (int i = 0; i < bitset_words; i++) { - const BITSET_WORD new_def = bd->defout[i] & ~child_bd->defin[i]; - child_bd->defin[i] |= new_def; - child_bd->defout[i] |= new_def; - cont |= new_def; - } - } - } } while (cont); }