mesa/src/intel
Alyssa Rosenzweig 7f6491b76d nir: Combine if_uses with instruction uses
Every nir_ssa_def is part of a chain of uses, implemented with doubly linked
lists.  That means each requires 2 * 64-bit = 16 bytes per def, which is
memory intensive. Together they require 32 bytes per def. Not cool.

To cut that memory use in half, we can combine the two linked lists into a
single use list that contains both regular instruction uses and if-uses. To do
this, we augment the nir_src with a boolean "is_if", and reimplement the
abstract if-uses operations on top of that list. That boolean should fit into
the padding already in nir_src so should not actually affect memory use, and in
the future we sneak it into the bottom bit of a pointer.

However, this creates a new inefficiency: now iterating over regular uses
separate from if-uses is (nominally) more expensive. It turns out virtually
every caller of nir_foreach_if_use(_safe) also calls nir_foreach_use(_safe)
immediately before, so we rewrite most of the callers to instead call a new
single `nir_foreach_use_including_if(_safe)` which predicates the logic based on
`src->is_if`. This should mitigate the performance difference.

There's a bit of churn, but this is largely a mechanical set of changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22343>
2023-04-07 23:48:03 +00:00
..
blorp anv,blorp,iris: Set PreferredSLMAllocationSize on gfx125+ 2023-04-06 10:54:47 +00:00
ci Uprev Piglit to 2391a83d1639a7ab7bbea02853b922878687b0e5 2023-04-04 15:37:14 +00:00
common intel/common: limit the amount of SLM with Wa_14017341140 2023-04-06 10:54:47 +00:00
compiler nir: Combine if_uses with instruction uses 2023-04-07 23:48:03 +00:00
dev intel/dev: set a default valid kmd_type 2023-04-03 23:34:17 +00:00
ds perfetto: Move intel's cmdbuf/queue annotation code to the shared util. 2023-03-30 02:19:35 +00:00
genxml intel/genxml: Add the preferred slm size enum for gen125 2023-04-06 10:54:46 +00:00
isl isl: update max buffer size for SKL+ 2023-04-03 06:18:52 +00:00
nullhw-layer vulkan/layers: Use PUBLIC instead of VK_LAYER_EXPORT 2023-02-17 03:42:34 +00:00
perf intel/perf: fix OA format selection on MTL 2023-04-03 23:34:17 +00:00
tools intel/dev: create a helper dependency for libintel_dev 2023-03-02 00:01:27 +00:00
vulkan anv,hasvk: Use vk_features2_to_features 2023-04-07 18:16:40 -04:00
vulkan_hasvk anv,hasvk: Use vk_features2_to_features 2023-04-07 18:16:40 -04:00
meson.build blorp: add dependency on idep_intel_dev 2023-03-03 13:04:23 +00:00