agx: Recollect stored vectors at their use
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 15 Feb 2023 04:58:54 +0000 (23:58 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 23 Jun 2023 17:37:41 +0000 (17:37 +0000)
commita2dbe6b688d5931139012074e17dd93fb0b4e91e
tree1e9e6d56b5bfc2b064ff5c758347283957453e47
parent91d98975a6889ce0f1e2306245356cd3c0a9393a
agx: Recollect stored vectors at their use

This is Timur's cheesy solution to split-hell.shader_test. Seems to work ok
here.

Before: 94 inst, 588 bytes, 165 halfregs, 1 threads, 0 loops, 0:0 spills:fills
After: 63 inst, 454 bytes, 129 halfregs, 1 threads, 0 loops, 0:0 spills:fills

On Android GLES3.1 shader-db, a few shaders are helped a lot:

   total instructions in shared programs: 1781706 -> 1781473 (-0.01%)
   instructions in affected programs: 4284 -> 4051 (-5.44%)
   helped: 16
   HURT: 2
   Instructions are helped.

   total bytes in shared programs: 12197854 -> 12196640 (<.01%)
   bytes in affected programs: 29526 -> 28312 (-4.11%)
   helped: 20
   HURT: 2
   Bytes are helped.

   total halfregs in shared programs: 489007 -> 488755 (-0.05%)
   halfregs in affected programs: 945 -> 693 (-26.67%)
   helped: 7
   HURT: 0
   Halfregs are helped.

   total threads in shared programs: 18873216 -> 18875008 (<.01%)
   threads in affected programs: 5376 -> 7168 (33.33%)
   helped: 7
   HURT: 0
   Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23832>
src/asahi/compiler/agx_compile.c