From a7e0eec62be1badc1ad953ad45eea5289af1b76b Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 4 Jan 2024 16:11:22 -0800 Subject: [PATCH] intel/brw: Pull fixup_3src_null_dest out of fs_visitor Rename fixup to lower and return the already present progress value for consistency. Reviewed-by: Lionel Landwerlin Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs.cpp | 34 ++++++++++++++++++---------------- src/intel/compiler/brw_fs.h | 2 +- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 0f7d9485482..21f2d9b9895 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -5834,22 +5834,24 @@ brw_fs_lower_sends_overlapping_payload(fs_visitor &s) * Three source instruction must have a GRF/MRF destination register. * ARF NULL is not allowed. Fix that up by allocating a temporary GRF. */ -void -fs_visitor::fixup_3src_null_dest() +bool +brw_fs_lower_3src_null_dest(fs_visitor &s) { bool progress = false; - foreach_block_and_inst_safe (block, fs_inst, inst, cfg) { - if (inst->is_3src(compiler) && inst->dst.is_null()) { - inst->dst = fs_reg(VGRF, alloc.allocate(dispatch_width / 8), + foreach_block_and_inst_safe (block, fs_inst, inst, s.cfg) { + if (inst->is_3src(s.compiler) && inst->dst.is_null()) { + inst->dst = fs_reg(VGRF, s.alloc.allocate(s.dispatch_width / 8), inst->dst.type); progress = true; } } if (progress) - invalidate_analysis(DEPENDENCY_INSTRUCTION_DETAIL | - DEPENDENCY_VARIABLES); + s.invalidate_analysis(DEPENDENCY_INSTRUCTION_DETAIL | + DEPENDENCY_VARIABLES); + + return progress; } static bool @@ -6346,7 +6348,7 @@ fs_visitor::run_vs() assign_curb_setup(); assign_vs_urb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6476,7 +6478,7 @@ fs_visitor::run_tcs() assign_curb_setup(); assign_tcs_urb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6508,7 +6510,7 @@ fs_visitor::run_tes() assign_curb_setup(); assign_tes_urb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6557,7 +6559,7 @@ fs_visitor::run_gs() assign_curb_setup(); assign_gs_urb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6665,7 +6667,7 @@ fs_visitor::run_fs(bool allow_spilling, bool do_rep_send) assign_urb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6706,7 +6708,7 @@ fs_visitor::run_cs(bool allow_spilling) assign_curb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6738,7 +6740,7 @@ fs_visitor::run_bs(bool allow_spilling) assign_curb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6771,7 +6773,7 @@ fs_visitor::run_task(bool allow_spilling) assign_curb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ @@ -6804,7 +6806,7 @@ fs_visitor::run_mesh(bool allow_spilling) assign_curb_setup(); - fixup_3src_null_dest(); + brw_fs_lower_3src_null_dest(*this); emit_dummy_memory_fence_before_eot(); /* Wa_14015360517 */ diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index 044a70f92ee..d1c8779e23c 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -237,7 +237,6 @@ public: void optimize(); void allocate_registers(bool allow_spilling); uint32_t compute_max_register_pressure(); - void fixup_3src_null_dest(); void emit_dummy_memory_fence_before_eot(); void emit_dummy_mov_instruction(); void assign_curb_setup(); @@ -588,6 +587,7 @@ bool brw_lower_dpas(fs_visitor &v); void nir_to_brw(fs_visitor *s); +bool brw_fs_lower_3src_null_dest(fs_visitor &s); bool brw_fs_lower_barycentrics(fs_visitor &s); bool brw_fs_lower_constant_loads(fs_visitor &s); bool brw_fs_lower_derivatives(fs_visitor &s);