From 5bd0750921661a1b2f10229d7d843d34e2708867 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 14 Jun 2023 10:46:44 -0700 Subject: [PATCH] intel/fs: Simplify compute_start_end(). Now that we have moved the screening up, we can simplify the code. No change in shader-db steam performance, n=10. Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs_live_variables.cpp | 25 +++++++------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/intel/compiler/brw_fs_live_variables.cpp b/src/intel/compiler/brw_fs_live_variables.cpp index c8f8f8cd989..f56692214da 100644 --- a/src/intel/compiler/brw_fs_live_variables.cpp +++ b/src/intel/compiler/brw_fs_live_variables.cpp @@ -236,23 +236,16 @@ fs_live_variables::compute_start_end() { foreach_block (block, cfg) { struct block_data *bd = &block_data[block->num]; + unsigned i; - for (int w = 0; w < bitset_words; w++) { - BITSET_WORD livedefin = bd->livein[w]; - BITSET_WORD livedefout = bd->liveout[w]; - BITSET_WORD livedefinout = livedefin | livedefout; - while (livedefinout) { - unsigned b = u_bit_scan(&livedefinout); - unsigned i = w * BITSET_WORDBITS + b; - if (livedefin & (1u << b)) { - start[i] = MIN2(start[i], block->start_ip); - end[i] = MAX2(end[i], block->start_ip); - } - if (livedefout & (1u << b)) { - start[i] = MIN2(start[i], block->end_ip); - end[i] = MAX2(end[i], block->end_ip); - } - } + BITSET_FOREACH_SET(i, bd->livein, (unsigned)num_vars) { + start[i] = MIN2(start[i], block->start_ip); + end[i] = MAX2(end[i], block->start_ip); + } + + BITSET_FOREACH_SET(i, bd->liveout, (unsigned)num_vars) { + start[i] = MIN2(start[i], block->end_ip); + end[i] = MAX2(end[i], block->end_ip); } } }