mesa/src/asahi/compiler
Alyssa Rosenzweig 3570e94bcc agx: Use agx_nir_opt_preamble
Now that everything is in place, we can actually take advantage of
preambles. This wins us a crude form of UBO pushing (accounting for most
of the win here), as well as its intended purpose of optimizing
uniform-on-uniform arithmetic.

shader-db results are excellent. The shader that's regressed for instruction
count is a fragment shader that solely consists of `gl_FragColor = uniform`,
which goes from a vectorized UBO load to four scalar moves. That's more
instructions (and more bytes) but presumably faster, since ALU should be much
cheaper than load/store.

total instructions in shared programs: 6502 -> 5764 (-11.35%)
instructions in affected programs: 5136 -> 4398 (-14.37%)
helped: 60
HURT: 1
helped stats (abs) min: 2.0 max: 47.0 x̄: 12.33 x̃: 8
helped stats (rel) min: 0.84% max: 34.48% x̄: 18.69% x̃: 21.05%
HURT stats (abs)   min: 2.0 max: 2.0 x̄: 2.00 x̃: 2
HURT stats (rel)   min: 33.33% max: 33.33% x̄: 33.33% x̃: 33.33%
95% mean confidence interval for instructions value: -14.69 -9.51
95% mean confidence interval for instructions %-change: -20.49% -15.20%
Instructions are helped.

total bytes in shared programs: 42186 -> 38310 (-9.19%)
bytes in affected programs: 33182 -> 29306 (-11.68%)
helped: 60
HURT: 1
helped stats (abs) min: 10.0 max: 272.0 x̄: 64.83 x̃: 50
helped stats (rel) min: 0.72% max: 30.00% x̄: 15.16% x̃: 16.67%
HURT stats (abs)   min: 14.0 max: 14.0 x̄: 14.00 x̃: 14
HURT stats (rel)   min: 31.82% max: 31.82% x̄: 31.82% x̃: 31.82%
95% mean confidence interval for bytes value: -77.73 -49.35
95% mean confidence interval for bytes %-change: -16.66% -12.11%
Bytes are helped.

total halfregs in shared programs: 2370 -> 1639 (-30.84%)
halfregs in affected programs: 1804 -> 1073 (-40.52%)
helped: 60
HURT: 0
helped stats (abs) min: 1.0 max: 40.0 x̄: 12.18 x̃: 8
helped stats (rel) min: 3.85% max: 72.73% x̄: 41.37% x̃: 36.17%
95% mean confidence interval for halfregs value: -14.77 -9.60
95% mean confidence interval for halfregs %-change: -46.00% -36.75%
Halfregs are helped.

Total CPU time (seconds): 2.71 -> 2.80 (3.32%)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18813>
2022-10-22 15:00:12 -04:00
..
test agx: Preload vertex/instance ID only at start 2022-10-14 01:37:39 +00:00
agx_builder.h.py agx: Switch to dynamic allocation of srcs/dests 2022-10-14 01:37:39 +00:00
agx_compile.c agx: Use agx_nir_opt_preamble 2022-10-22 15:00:12 -04:00
agx_compile.h agx: Report GPRs to the driver 2022-10-22 15:00:01 -04:00
agx_compiler.h agx: Add agx_nir_opt_preamble pass 2022-10-22 15:00:07 -04:00
agx_dce.c agx: Make DCE dumber 2022-05-01 22:00:00 -04:00
agx_liveness.c agx: Add iterators for phi/non-phi instructions 2022-10-14 01:37:39 +00:00
agx_lower_64bit.c agx: Handle 64-bit moves 2022-10-22 14:59:52 -04:00
agx_lower_parallel_copy.c agx: Handle uniforms passed to COLLECT 2022-10-22 14:59:48 -04:00
agx_lower_pseudo.c agx: Switch to dynamic allocation of srcs/dests 2022-10-14 01:37:39 +00:00
agx_lower_resinfo.c agx: Lower txs to a descriptor crawl 2022-09-13 16:04:29 +00:00
agx_minifloat.h agx: Port minifloat tests to GTest 2022-08-01 18:34:11 +00:00
agx_nir_lower_array_texture.c agx: Convert and clamp array indices in NIR 2022-09-19 16:14:24 +00:00
agx_nir_opt_preamble.c agx: Add agx_nir_opt_preamble pass 2022-10-22 15:00:07 -04:00
agx_opcodes.c.py agx: Generate runtime-accessible opcode table 2021-05-02 17:41:10 -04:00
agx_opcodes.h.py agx: Print agx_dim appropriately 2022-10-14 01:37:39 +00:00
agx_opcodes.py agx: Add uniform_store instruction 2022-10-22 14:59:40 -04:00
agx_optimizer.c agx: Handle 64-bit moves 2022-10-22 14:59:52 -04:00
agx_pack.c agx: Avoid reading high uniforms from device_load 2022-10-22 14:59:59 -04:00
agx_print.c agx: Handle 64-bit moves 2022-10-22 14:59:52 -04:00
agx_register_allocate.c agx: Report GPRs to the driver 2022-10-22 15:00:01 -04:00
agx_uniforms.c agx: Make push_count public 2022-10-22 14:59:34 -04:00
agx_validate.c agx: Allow larger indices for ld/st 2022-10-22 14:59:43 -04:00
meson.build agx: Add agx_nir_opt_preamble pass 2022-10-22 15:00:07 -04:00