intel/brw: Pull lower_simd_width out of fs_visitor

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26887>
This commit is contained in:
Caio Oliveira
2024-01-03 15:39:23 -08:00
committed by Marge Bot
parent 14954cbd58
commit af2b3c478c
2 changed files with 10 additions and 10 deletions
+9 -9
View File
@@ -4982,12 +4982,12 @@ emit_zip(const fs_builder &lbld_before, const fs_builder &lbld_after,
}
bool
fs_visitor::lower_simd_width()
brw_fs_lower_simd_width(fs_visitor &s)
{
bool progress = false;
foreach_block_and_inst_safe(block, fs_inst, inst, cfg) {
const unsigned lower_width = get_lowered_simd_width(this, inst);
foreach_block_and_inst_safe(block, fs_inst, inst, s.cfg) {
const unsigned lower_width = get_lowered_simd_width(&s, inst);
if (lower_width != inst->exec_size) {
/* Builder matching the original instruction. We may also need to
@@ -4997,7 +4997,7 @@ fs_visitor::lower_simd_width()
*/
const unsigned max_width = MAX2(inst->exec_size, lower_width);
const fs_builder bld = fs_builder(this).at_end();
const fs_builder bld = fs_builder(&s).at_end();
const fs_builder ibld = bld.at(block, inst)
.exec_all(inst->force_writemask_all)
.group(max_width, inst->group / max_width);
@@ -5007,7 +5007,7 @@ fs_visitor::lower_simd_width()
*/
const unsigned n = DIV_ROUND_UP(inst->exec_size, lower_width);
const unsigned residency_size = inst->has_sampler_residency() ?
(reg_unit(devinfo) * REG_SIZE) : 0;
(reg_unit(s.devinfo) * REG_SIZE) : 0;
const unsigned dst_size =
(inst->size_written - residency_size) /
inst->dst.component_size(inst->exec_size);
@@ -5094,7 +5094,7 @@ fs_visitor::lower_simd_width()
}
if (progress)
invalidate_analysis(DEPENDENCY_INSTRUCTIONS | DEPENDENCY_VARIABLES);
s.invalidate_analysis(DEPENDENCY_INSTRUCTIONS | DEPENDENCY_VARIABLES);
return progress;
}
@@ -5701,7 +5701,7 @@ fs_visitor::optimize()
OPT(brw_fs_opt_dead_code_eliminate, *this);
}
OPT(lower_simd_width);
OPT(brw_fs_lower_simd_width, *this);
OPT(lower_barycentrics);
OPT(lower_logical_sends);
@@ -5744,7 +5744,7 @@ fs_visitor::optimize()
OPT(brw_fs_opt_algebraic, *this);
OPT(brw_fs_opt_register_coalesce, *this);
OPT(lower_simd_width);
OPT(brw_fs_lower_simd_width, *this);
OPT(brw_fs_opt_dead_code_eliminate, *this);
}
@@ -5765,7 +5765,7 @@ fs_visitor::optimize()
if (OPT(brw_fs_opt_copy_propagation, *this))
OPT(brw_fs_opt_algebraic, *this);
OPT(brw_fs_opt_dead_code_eliminate, *this);
OPT(lower_simd_width);
OPT(brw_fs_lower_simd_width, *this);
}
OPT(fixup_sends_duplicate_payload);
+1 -1
View File
@@ -277,7 +277,6 @@ public:
bool lower_regioning();
bool lower_logical_sends();
bool lower_integer_multiplication();
bool lower_simd_width();
bool lower_barycentrics();
bool lower_derivatives();
bool lower_find_live_channel();
@@ -606,6 +605,7 @@ void nir_to_brw(fs_visitor *s);
bool brw_fs_lower_constant_loads(fs_visitor &s);
bool brw_fs_lower_pack(fs_visitor &s);
bool brw_fs_lower_simd_width(fs_visitor &s);
bool brw_fs_opt_algebraic(fs_visitor &s);
bool brw_fs_opt_bank_conflicts(fs_visitor &s);