Commit graph

10 commits

Author SHA1 Message Date
Alyssa Rosenzweig
d1eb17e92e treewide: Drop nir_ssa_for_src users
Via Coccinelle patch:

    @@
    expression b, s, n;
    @@

    -nir_ssa_for_src(b, *s, n)
    +s->ssa

    @@
    expression b, s, n;
    @@

    -nir_ssa_for_src(b, s, n)
    +s.ssa

Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25247>
2023-09-18 10:25:17 -04:00
Dave Airlie
18ca6c37f0 nir: add a function usage tracker
allows dropping old fns

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
f5bf4657fb nir: add driver_functions option to avoid inlining.
This adds a driver control to instruct NIR to not inline
all functions.

It adds a very simple inlining heuristic that works for
what I've played with, but will probably need to grow some
better ideas.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
a74e98547c nir: don't inline linked functions
Don't inline linked functions here, let nir_inline_functions do the job
when we get to it.

Instead just copy over the implementation and any other pieces need.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
5dea1ac64c nir/functions: move linker pass to new helper
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
b1a12cf3a8 nir/functions: put link state into a struct
this will make it easier to convert to new pass.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
4af6061fe5 nir/functions: use helper to get function for a name.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
bfe152916c nir: move the libclc lowering over to functions file.
This lowering is pretty generic, and I want to enhance it for
times when we don't want to inline.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
e6bfe7c501 nir: use nir_function_instructions_pass in the inliner.
This moves the current inliner to use the pass.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Dave Airlie
5f568625fa nir: rename nir_inline_functions.c to nir_functions.c
I'm going to add code for non-inline purposes but related to
functions.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>
2023-09-12 01:57:50 +00:00
Renamed from src/compiler/nir/nir_inline_functions.c (Browse further)