intel/fs: Linked list micro optimizations in brw_nir_move_interpolation_to_top
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 21 Mar 2023 03:57:47 +0000 (20:57 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 19:07:50 +0000 (19:07 +0000)
commit3037603b703f68d184057df475f78069d6d0221f
tree15d3d400eab148834054ba015f9b77b7f5210a00
parent78ee74de4a37df75c0745e15254753f1f9ab8aa8
intel/fs: Linked list micro optimizations in brw_nir_move_interpolation_to_top

Two linked list management changes:

- Use the list head sentinel as the initial cursor. It is, after all, a
  proper node in the list.

- Iterate the list of blocks starting with the second block instead of
  skipping the first block in the loop.

On my Ice Lake laptop (using a locked CPU speed and other measures to
prevent thermal throttling, etc.) using a release build, improves
performance of compiling shaders from batman_arkham_city_goty.foz by
-0.24% ± 0.09% (n = 5, pooled s = 0.324106).

v2: Use nir_cursor instead of direct list manipultion. Suggested by
Lionel.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22299>
src/intel/compiler/brw_fs.cpp