intel/fs: run VGRF compaction just before max live register accounting
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 17 Mar 2023 07:42:31 +0000 (09:42 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 5 Apr 2023 12:32:56 +0000 (12:32 +0000)
There are a number of instances of the dead code elimination pass that
could reduce the count. For some reason this also seems to affect
register allocation itself.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

src/intel/compiler/brw_fs.cpp

index b22b32e..77cd0b7 100644 (file)
@@ -6506,6 +6506,8 @@ fs_visitor::allocate_registers(bool allow_spilling)
       "lifo"
    };
 
+   compact_virtual_grfs();
+
    if (needs_register_pressure)
       shader_stats.max_register_pressure = compute_max_register_pressure();