From c18de3f0482c0397c634ce02124a2987f69caa93 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 18 Jun 2024 13:38:19 -0700 Subject: [PATCH] intel/brw: Delay liveness calculations in saturate propagation Wait and see if we actually have a candidate for saturate propagation before requesting liveness info. Saves the calculation in the case where we have nothing to do. Cuts compile time in Borderlands 3 by -0.304754% +/- 0.194162% (n=25). Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs_saturate_propagation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/brw_fs_saturate_propagation.cpp b/src/intel/compiler/brw_fs_saturate_propagation.cpp index 47e62c746b9..5bfda06e824 100644 --- a/src/intel/compiler/brw_fs_saturate_propagation.cpp +++ b/src/intel/compiler/brw_fs_saturate_propagation.cpp @@ -45,7 +45,7 @@ using namespace brw; */ static bool -opt_saturate_propagation_local(const fs_live_variables &live, bblock_t *block) +opt_saturate_propagation_local(fs_visitor &s, bblock_t *block) { bool progress = false; int ip = block->end_ip + 1; @@ -61,6 +61,7 @@ opt_saturate_propagation_local(const fs_live_variables &live, bblock_t *block) inst->src[0].abs) continue; + const fs_live_variables &live = s.live_analysis.require(); int src_var = live.var_from_reg(inst->src[0]); int src_end_ip = live.end[src_var]; @@ -150,11 +151,10 @@ opt_saturate_propagation_local(const fs_live_variables &live, bblock_t *block) bool brw_fs_opt_saturate_propagation(fs_visitor &s) { - const fs_live_variables &live = s.live_analysis.require(); bool progress = false; foreach_block (block, s.cfg) { - progress = opt_saturate_propagation_local(live, block) || progress; + progress = opt_saturate_propagation_local(s, block) || progress; } /* Live intervals are still valid. */