From ce71f2badd45caa447f02a5644877a054c7aa5c1 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Thu, 13 Mar 2025 00:26:43 -0700 Subject: [PATCH] brw: Move defs analysis back to its place in saturate propagation The premise of the change was wrong: the case where the defs analysis was required was rare and requiring the analysis inside just the case we care was being used for another analysis too. So for now, the change doesn't really helps. I'll revisit this whole pass later on. This backs out commit 6e1921581043c145049e199d64e11c8a64037c8b. Acked-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_opt_saturate_propagation.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/intel/compiler/brw_opt_saturate_propagation.cpp b/src/intel/compiler/brw_opt_saturate_propagation.cpp index f2c631447ca..ed8175ddfb0 100644 --- a/src/intel/compiler/brw_opt_saturate_propagation.cpp +++ b/src/intel/compiler/brw_opt_saturate_propagation.cpp @@ -86,9 +86,7 @@ propagate_sat(brw_inst *inst, brw_inst *scan_inst) } static bool -opt_saturate_propagation_local(brw_shader &s, - const brw_def_analysis &defs, - bblock_t *block) +opt_saturate_propagation_local(brw_shader &s, bblock_t *block) { bool progress = false; int ip = block->end_ip + 1; @@ -104,6 +102,7 @@ opt_saturate_propagation_local(brw_shader &s, inst->src[0].abs) continue; + const brw_def_analysis &defs = s.def_analysis.require(); brw_inst *def = defs.get(inst->src[0]); if (def != NULL) { @@ -193,10 +192,8 @@ brw_opt_saturate_propagation(brw_shader &s) { bool progress = false; - const brw_def_analysis &defs = s.def_analysis.require(); - foreach_block (block, s.cfg) { - progress = opt_saturate_propagation_local(s, defs, block) || progress; + progress = opt_saturate_propagation_local(s, block) || progress; } if (progress)