agx/opt_preamble: restrain ourselves

hoisting EVERYTHING is counterproductive now that we can remat constants.

total instructions in shared programs: 2038818 -> 2038338 (-0.02%)
instructions in affected programs: 33002 -> 32522 (-1.45%)
helped: 9
HURT: 3
Instructions are helped.

total alu in shared programs: 1594051 -> 1593474 (-0.04%)
alu in affected programs: 22012 -> 21435 (-2.62%)
helped: 12
HURT: 0
Alu are helped.

total fscib in shared programs: 1590211 -> 1589634 (-0.04%)
fscib in affected programs: 22012 -> 21435 (-2.62%)
helped: 12
HURT: 0
Fscib are helped.

total bytes in shared programs: 13978022 -> 13975162 (-0.02%)
bytes in affected programs: 219746 -> 216886 (-1.30%)
helped: 12
HURT: 0
Bytes are helped.

total regs in shared programs: 592854 -> 592758 (-0.02%)
regs in affected programs: 954 -> 858 (-10.06%)
helped: 6
HURT: 0
Regs are helped.

total uniforms in shared programs: 1516579 -> 1516534 (<.01%)
uniforms in affected programs: 4605 -> 4560 (-0.98%)
helped: 9
HURT: 0
Uniforms are helped.

total threads in shared programs: 20329216 -> 20329600 (<.01%)
threads in affected programs: 3840 -> 4224 (10.00%)
helped: 6
HURT: 0
Threads are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
This commit is contained in:
Alyssa Rosenzweig
2024-03-05 18:33:06 -04:00
committed by Marge Bot
parent cae914978b
commit 4c77f59e8a
+6 -1
View File
@@ -168,7 +168,12 @@ static const nir_opt_preamble_options preamble_options = {
.instr_cost_cb = instr_cost,
.rewrite_cost_cb = rewrite_cost,
.avoid_instr_cb = avoid_instr,
.preamble_storage_size = 512,
/* hardware size is 512, but it's polite to leave some wiggle room to push
* hot constants so we don't end up rematerializing all over the place.
* 480 seems to be a sweetspot, based on a few minutes of shader-db.
*/
.preamble_storage_size = 480,
};
bool