[Mesa-dev] [PATCH 1/2] i965: Try not to reverse-schedule things when doing LIFO scheduling.

Matt Turner mattst88 at gmail.com
Thu Oct 24 06:02:04 CEST 2013

On Tue, Oct 22, 2013 at 1:46 PM, Eric Anholt <eric at anholt.net> wrote:
> The LIFO plan was simple: Take the most recently made available
> instructions, and pick those first.
> But because of the order we were pushing things onto our list of
> available-to-schedule instructions, it meant that when a set of
> instructions was made available at the same time (for example, everything
> at the start of the program that wasn't dependant on other instructions)
> we'd schedule them in reverse order.
> If you had 10 texture calls in a row in your program, each with
> independent argument setup, we'd set up the last texture call's args and
> execute it first, even though we wouldn't be able to consume its results
> until we'd finished the other 9 texture calls (assuming consumption of
> texture results happens near each texture call, and combines it with
> another texture result, which is normal for a convolution shader).
> To fix this, walk the list for doing LIFO in the order that instructions
> were originally generated in the program, but choose to push
> newly-made-available instructions to the other end of the list instead.
> total instructions in shared programs: 1587242 -> 1586290 (-0.06%)
> instructions in affected programs:     7801 -> 6849 (-12.20%)
> GAINED:                                76
> LOST:                                  67
> ---

I imagine that there are still ways to make this better, but this
(patch 2 especially) is a really nice improvement for such a small

Both are

Reviewed-by: Matt Turner <mattst88 at gmail.com>

More information about the mesa-dev mailing list