freedreno/ir3: Reduce choose_instr_dec() and _inc() overhead.
authorEmma Anholt <emma@anholt.net>
Tue, 13 Jul 2021 20:39:36 +0000 (13:39 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 19 Jul 2021 23:16:54 +0000 (23:16 +0000)
commitbda26dfcfc5f9012ab1bd22f2bbaa664315e2671
tree266bc7d592120e1519b5b98c3d2fe4b374c2098c
parent56dd1adf3b8b377b301e5973bf19c540c757ac54
freedreno/ir3: Reduce choose_instr_dec() and _inc() overhead.

If you didn't have a freed+ready instruction, you'd redo the live_effect
and check_instr() logic multiple times per instr.  Replace the multiple
loops in each function with a ranking that I think is more readable,
reducing the overhead in the process.

debugoptimized dEQP-GLES31.functional.ubo.random.all_per_block_buffers.20
runtime goes from ~3.5s -> ~3.0s on my lazor.  No shader-db change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11855>
src/freedreno/ir3/ir3_sched.c