From 09450faf6a190170b68613f5a99c3af131f9c97a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 25 Feb 2025 17:33:55 -0800 Subject: [PATCH] brw: Do cmod prop again after post-RA scheduling shader-db: All Intel platforms had similar results. (Meteor Lake shown) total instructions in shared programs: 19968728 -> 19963825 (-0.02%) instructions in affected programs: 788014 -> 783111 (-0.62%) helped: 2503 / HURT: 0 total cycles in shared programs: 884112912 -> 884093268 (<.01%) cycles in affected programs: 20017168 -> 19997524 (-0.10%) helped: 1830 / HURT: 52 LOST: 0 GAINED: 6 fossil-db: All Intel platforms had similar results. (Meteor Lake shown) Totals: Instrs: 980768016 -> 980172179 (-0.06%) Cycle count: 91762351767 -> 91757280093 (-0.01%); split: -0.01%, +0.00% Max dispatch width: 37602592 -> 37608768 (+0.02%) Totals from 157150 (6.98% of 2251329) affected shaders: Instrs: 107323207 -> 106727370 (-0.56%) Cycle count: 12696754006 -> 12691682332 (-0.04%); split: -0.04%, +0.00% Max dispatch width: 3708584 -> 3714760 (+0.17%) Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw/brw_shader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/intel/compiler/brw/brw_shader.cpp b/src/intel/compiler/brw/brw_shader.cpp index 72474061a28..b857273c639 100644 --- a/src/intel/compiler/brw/brw_shader.cpp +++ b/src/intel/compiler/brw/brw_shader.cpp @@ -1321,6 +1321,14 @@ brw_allocate_registers(brw_shader &s, bool allow_spilling) */ OPT_V(brw_lower_vgrfs_to_fixed_grfs); + /* brw_opt_dead_code_eliminate cannot be run after + * brw_lower_vgrfs_to_fixed_grfs as it depends on VGRFs. cmod propagation + * mostly cleans up after itself. The only thing DCE could do would be to + * eliminate writes to registers that are unread. Since register allocation + * and final scheduling has already happend, this won't help. + */ + OPT(brw_opt_cmod_propagation); + if (s.devinfo->ver >= 30) OPT(brw_lower_send_gather);