mesa/src/compiler/spirv
Konstantin Seurer de32f9275f treewide: add & use parent instr helpers
We add a bunch of new helpers to avoid the need to touch >parent_instr,
including the full set of:

* nir_def_is_*
* nir_def_as_*_or_null
* nir_def_as_* [assumes the right instr type]
* nir_src_is_*
* nir_src_as_*
* nir_scalar_is_*
* nir_scalar_as_*

Plus nir_def_instr() where there's no more suitable helper.

Also an existing helper is renamed to unify all the names, while we're
churning the tree:

* nir_src_as_alu_instr -> nir_src_as_alu

..and then we port the tree to use the helpers as much as possible, using
nir_def_instr() where that does not work.

Acked-by: Marek Olšák <maraeo@gmail.com>

---

To eliminate nir_def::parent_instr we need to churn the tree anyway, so I'm
taking this opportunity to clean up a lot of NIR patterns.

Co-authored-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38313>
2025-11-12 21:22:13 +00:00
..
tests treewide: add & use parent instr helpers 2025-11-12 21:22:13 +00:00
gl_spirv.c all: rename gl_shader_stage to mesa_shader_stage 2025-08-06 10:28:40 +08:00
GLSL.ext.AMD.h spirv: Update headers and grammer JSON 2023-08-18 16:57:22 +00:00
GLSL.std.450.h spirv: bump headers 2025-06-06 14:38:17 +00:00
meson.build mesa: stop using inc_mesa in most places that have nothing to do with GL 2025-08-06 20:35:26 +00:00
nir_spirv.h shader_info: remove gl_subgroup_size enum 2025-09-12 21:05:17 +00:00
NonSemanticShaderDebugInfo100.h spirv: bump headers 2025-06-06 14:38:17 +00:00
OpenCL.std.h spirv: bump headers 2025-06-06 14:38:17 +00:00
spir-v.xml spirv: Update headers and metadata from latest Khronos commit 2025-08-08 22:41:14 +00:00
spirv.core.grammar.json spirv: Update the JSON and headers 2025-10-24 16:00:55 +00:00
spirv.h spirv: Update the JSON and headers 2025-10-24 16:00:55 +00:00
spirv2nir.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
spirv_info_gen.py build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
spirv_to_nir.c vtn: Fix OpCopyLogical destination type 2025-11-12 20:30:30 +01:00
vtn_alu.c nir: guard nir_def_as_alu() 2025-10-30 19:28:06 +00:00
vtn_amd.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
vtn_bindgen2.c vtn_bindgen2: use anonymous namespace to avoid name collisions 2025-10-09 19:18:58 +00:00
vtn_cfg.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
vtn_cmat.c spirv: move cmat store barrier after the store. 2025-08-05 22:28:03 +00:00
vtn_debug.c vtn: Add a debug flag to dump SPIR-V assembly 2024-08-28 21:52:59 +00:00
vtn_gather_types_c.py spirv: OpAsmTargetINTEL is untyped 2025-03-08 19:54:19 +00:00
vtn_generator_ids_h.py util,vulkan,mesa,compiler: Generate source files with utf8 encoding from mako template 2023-12-07 12:41:07 +00:00
vtn_glsl450.c vtn: use vtn_has_decoration more 2025-09-05 15:58:03 +00:00
vtn_opencl.c treewide: add & use parent instr helpers 2025-11-12 21:22:13 +00:00
vtn_private.h vtn: use vtn_has_decoration more 2025-09-05 15:58:03 +00:00
vtn_structured_cfg.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
vtn_subgroup.c spirv: ensure ballot find_lsb/find_msb/bit_count have 32bit result 2025-09-04 14:03:58 +00:00
vtn_variables.c treewide: add & use parent instr helpers 2025-11-12 21:22:13 +00:00