From 73fe65845652f97883a609f54b935cc754f470c0 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 3 Jan 2024 14:51:58 -0800 Subject: [PATCH] intel/brw: Pull eliminate_find_live_channel out of fs_visitor Reviewed-by: Lionel Landwerlin Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs.cpp | 12 ++++++------ src/intel/compiler/brw_fs.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 7b0c7070dba..bab2c275164 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -3174,13 +3174,13 @@ brw_fs_opt_remove_redundant_halts(fs_visitor &s) * analysis. */ bool -fs_visitor::eliminate_find_live_channel() +brw_fs_opt_eliminate_find_live_channel(fs_visitor &s) { bool progress = false; unsigned depth = 0; - if (!brw_stage_has_packed_dispatch(devinfo, stage, max_polygons, - stage_prog_data)) { + if (!brw_stage_has_packed_dispatch(s.devinfo, s.stage, s.max_polygons, + s.stage_prog_data)) { /* The optimization below assumes that channel zero is live on thread * dispatch, which may not be the case if the fixed function dispatches * threads sparsely. @@ -3188,7 +3188,7 @@ fs_visitor::eliminate_find_live_channel() return false; } - foreach_block_and_inst_safe(block, fs_inst, inst, cfg) { + foreach_block_and_inst_safe(block, fs_inst, inst, s.cfg) { switch (inst->opcode) { case BRW_OPCODE_IF: case BRW_OPCODE_DO: @@ -3223,7 +3223,7 @@ fs_visitor::eliminate_find_live_channel() out: if (progress) - invalidate_analysis(DEPENDENCY_INSTRUCTION_DETAIL); + s.invalidate_analysis(DEPENDENCY_INSTRUCTION_DETAIL); return progress; } @@ -5688,7 +5688,7 @@ fs_visitor::optimize() OPT(dead_control_flow_eliminate, this); OPT(brw_fs_opt_saturate_propagation, *this); OPT(register_coalesce); - OPT(eliminate_find_live_channel); + OPT(brw_fs_opt_eliminate_find_live_channel, *this); OPT(brw_fs_opt_compact_virtual_grfs, *this); } while (progress); diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index b0f621c773a..cb6b3d31bf8 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -266,7 +266,6 @@ public: #endif bool register_coalesce(); - bool eliminate_find_live_channel(); bool remove_extra_rounding_modes(); fs_instruction_scheduler *prepare_scheduler(void *mem_ctx); @@ -618,6 +617,7 @@ bool brw_fs_opt_compact_virtual_grfs(fs_visitor &s); bool brw_fs_opt_copy_propagation(fs_visitor &s); bool brw_fs_opt_cse(fs_visitor &s); bool brw_fs_opt_dead_code_eliminate(fs_visitor &s); +bool brw_fs_opt_eliminate_find_live_channel(fs_visitor &s); bool brw_fs_opt_peephole_sel(fs_visitor &s); bool brw_fs_opt_remove_redundant_halts(fs_visitor &s); bool brw_fs_opt_saturate_propagation(fs_visitor &s);