From 92f5442489e2d021adb5e25d6df6f3189d37bcd9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 13 Sep 2023 17:52:29 -0700 Subject: [PATCH] intel/fs: Merge copy prop dataflow loops This is kept as a separate commit because the change looks like a lot more than it it. The order of the two loops is swapped, then the two loops are merged. Suggested-by: Kenneth Graunke Part-of: --- .../compiler/brw_fs_copy_propagation.cpp | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp index fd385672f74..6a8429fa2a5 100644 --- a/src/intel/compiler/brw_fs_copy_propagation.cpp +++ b/src/intel/compiler/brw_fs_copy_propagation.cpp @@ -372,24 +372,6 @@ fs_copy_prop_dataflow::setup_initial_values() for (int i = 0; i < num_acp; i++) acp_table.add(acp[i]); - foreach_block (block, cfg) { - foreach_inst_in_block(fs_inst, inst, block) { - if (inst->dst.file != VGRF) - continue; - - for (auto iter = acp_table.find_by_dst(inst->dst.nr); - iter != acp_table.end() && (*iter)->dst.nr == inst->dst.nr; - ++iter) { - if (grf_regions_overlap(inst->dst, inst->size_written, - (*iter)->dst, (*iter)->size_written)) { - BITSET_SET(bd[block->num].kill, (*iter)->global_idx); - if (inst->force_writemask_all && !(*iter)->force_writemask_all) - BITSET_SET(bd[block->num].exec_mismatch, (*iter)->global_idx); - } - } - } - } - foreach_block (block, cfg) { foreach_inst_in_block(fs_inst, inst, block) { if (inst->dst.file != VGRF && @@ -406,6 +388,20 @@ fs_copy_prop_dataflow::setup_initial_values() BITSET_SET(bd[block->num].exec_mismatch, (*iter)->global_idx); } } + + if (inst->dst.file != VGRF) + continue; + + for (auto iter = acp_table.find_by_dst(inst->dst.nr); + iter != acp_table.end() && (*iter)->dst.nr == inst->dst.nr; + ++iter) { + if (grf_regions_overlap(inst->dst, inst->size_written, + (*iter)->dst, (*iter)->size_written)) { + BITSET_SET(bd[block->num].kill, (*iter)->global_idx); + if (inst->force_writemask_all && !(*iter)->force_writemask_all) + BITSET_SET(bd[block->num].exec_mismatch, (*iter)->global_idx); + } + } } } }