From 2ad865b2197df9fd86da3c004579f6905763f15c Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Tue, 13 Jun 2023 12:50:02 -0700 Subject: [PATCH] intel: Count reads_remaining across all blocks. We were zeroing it out per block, but it doesn't actually help to count per block, since the question is "will scheduling this instruction free the reg?". Saves some memsetting, which was showing up high in the profile (but not from this source). No change on iris SKL shader-db. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw_schedule_instructions.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/intel/compiler/brw_schedule_instructions.cpp b/src/intel/compiler/brw_schedule_instructions.cpp index 3e88b186916..00dcf30b137 100644 --- a/src/intel/compiler/brw_schedule_instructions.cpp +++ b/src/intel/compiler/brw_schedule_instructions.cpp @@ -1916,14 +1916,16 @@ instruction_scheduler::run(cfg_t *cfg) if (!post_reg_alloc) setup_liveness(cfg); + if (reads_remaining) { + memset(reads_remaining, 0, + grf_count * sizeof(*reads_remaining)); + memset(hw_reads_remaining, 0, + hw_reg_count * sizeof(*hw_reads_remaining)); + memset(written, 0, grf_count * sizeof(*written)); + } + foreach_block(block, cfg) { if (reads_remaining) { - memset(reads_remaining, 0, - grf_count * sizeof(*reads_remaining)); - memset(hw_reads_remaining, 0, - hw_reg_count * sizeof(*hw_reads_remaining)); - memset(written, 0, grf_count * sizeof(*written)); - foreach_inst_in_block(fs_inst, inst, block) count_reads_remaining(inst); }