mesa/src/compiler/rust
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
..
proc nak,compiler: Move AsSlice to common code 2024-08-07 21:08:19 +00:00
.clang-format nak: memstream: move into common code 2024-10-17 02:50:21 +00:00
.rustfmt.toml
as_slice.rs compiler/rust: impl AsSlice for Box 2025-09-12 10:33:32 +00:00
bindings.h nak: memstream: move into common code 2024-10-17 02:50:21 +00:00
bindings.rs compiler/rust: Copy the Rust NIR wrappers from NAK 2024-08-07 21:08:18 +00:00
bitset.rs compiler/rust/bitset: Don't use a vector for expected sets in tests 2025-08-20 17:06:50 +00:00
cfg.rs compiler/rust/cfg: Use DepthFirstSearch for finding reaches sets 2025-10-14 22:47:40 +00:00
dataflow.rs nak/dataflow: Fix typo in comments 2025-10-30 12:49:11 +00:00
depth_first_search.rs compiler/rust: Implement dfs() non-recursively 2025-10-14 22:47:40 +00:00
lib.rs compiler/rust: Add a DepthFirstSearch trait 2025-10-14 22:47:38 +00:00
memstream.rs nak,nir: Stop using std::mem::zeroed() 2025-06-06 18:58:35 +00:00
meson.build compiler/rust: Add a DepthFirstSearch trait 2025-10-14 22:47:38 +00:00
nir.rs treewide: add & use parent instr helpers 2025-11-12 21:22:13 +00:00
nir_instr_printer.rs compiler/rust: Copy NirInstrPrinter from NAK 2024-10-18 12:43:52 +00:00
rust_helpers.c compiler/rust: Add a unit test for the memstream abstraction 2024-10-17 18:59:02 +00:00
rust_helpers.h compiler/rust: Add a unit test for the memstream abstraction 2024-10-17 18:59:02 +00:00
smallvec.rs compiler/rust: Copy MappedInstrs from NAK 2024-10-01 11:33:35 +00:00