Mesa (main): nir/nir_opt_move,sink: Include load_ubo_vec4 as a load_ubo instr.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Dec 11 03:05:19 UTC 2021


Module: Mesa
Branch: main
Commit: d199d65c3af6cc87cd77585b21435ddb5125654d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d199d65c3af6cc87cd77585b21435ddb5125654d

Author: Emma Anholt <emma at anholt.net>
Date:   Thu Dec  9 13:09:35 2021 -0800

nir/nir_opt_move,sink: Include load_ubo_vec4 as a load_ubo instr.

We weren't doing much motion in nir-to-tgsi because we considered all our
lowered load-ubos as unmovable.

softpipe shader-db:

total temps in shared programs: 563942 -> 563136 (-0.14%)
temps in affected programs: 9833 -> 9027 (-8.20%)

r300 shader-db:

instructions in affected programs: 22858 -> 23575 (3.14%)
temps in affected programs: 2039 -> 1813 (-11.08%)

(NIR had given r300 -19% instrs for +40% temps, so this feels like a
worthwhile trade back).

Reivewed-by: Jesse Natalie <jenatali at microsoft.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14138>

---

 src/compiler/nir/nir_opt_sink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/compiler/nir/nir_opt_sink.c b/src/compiler/nir/nir_opt_sink.c
index 279ecfdaca5..13eeb9ea54d 100644
--- a/src/compiler/nir/nir_opt_sink.c
+++ b/src/compiler/nir/nir_opt_sink.c
@@ -56,6 +56,7 @@ nir_can_move_instr(nir_instr *instr, nir_move_options options)
       nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
       switch (intrin->intrinsic) {
       case nir_intrinsic_load_ubo:
+      case nir_intrinsic_load_ubo_vec4:
          return options & nir_move_load_ubo;
       case nir_intrinsic_load_ssbo:
          return (options & nir_move_load_ssbo) && nir_intrinsic_can_reorder(intrin);



More information about the mesa-commit mailing list