i965/fs: Prefer more-critical instructions of the same age in LIFO scheduling.
authorEric Anholt <eric@anholt.net>
Mon, 28 Oct 2013 22:17:07 +0000 (15:17 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 30 Oct 2013 22:46:54 +0000 (15:46 -0700)
commit20dbeadd83ffca2345c4ba1f1ac27c19bade0d4a
treec5b73ddbd3cb2f043c76e5ecfbd1271a143c1e3e
parent017361dd37b678efa44facc4a396784f4ce980bc
i965/fs: Prefer more-critical instructions of the same age in LIFO scheduling.

When faced with a million instructions that all became candidates at the
same time (none of which individually reduce register pressure), the ones
on the critical path are more likely to be the ones that will free up some
candidates soon.

shader-db:
total instructions in shared programs: 1681070 -> 1681070 (0.00%)
instructions in affected programs:     0 -> 0
GAINED:                                40
LOST:                                  74

Fixes indistinguishable-from-hanging behavior in GLES3conform's
uniform_buffer_object_max_uniform_block_size test, regressed by
c3c9a8c85758796a26b48e484286e6b6f5a5299a.  Given that
93bd627d5a6c485948b94488e6cd53a06b7ebdcf was unlocked by that commit, the
net effect on 16-wide program count is still quite positive, and I think
this should give us more stable scheduling (less dependency on original
instruction emit order).

v2: Comment suggestions by Paul

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70943
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp