mesa/src
Jason Ekstrand cd4ffb376f intel/fs: Account for live range lengths in spill costs
The current register allocator has a concept of "spill benefit" which is
based on the number of nodes with which a given node interferes.  The
idea is that you want to spill stuff with high interference because
those are the most likely registers to help when spilling.  However,
this fails to take into account the length of the live range so the
allocator frequently picks "cheap" (not many uses) registers which are
actually very short lived and so spilling them doesn't help with the
pressure situation.

This commit takes into account the length of the live range to make
long-lived registers more likely to get spilled than short-lived ones.
This encourages the spill chooser to choose slightly larger registers
which will affect a larger area of the program and hopefully we have to
spill fewer of them to get the same reduction in over-all register
pressure.

Shader-db results on Kaby Lake:

    total spills in shared programs: 23664 -> 12050 (-49.08%)
    spills in affected programs: 19243 -> 7629 (-60.35%)
    helped: 296
    HURT: 8

    total fills in shared programs: 32028 -> 25139 (-21.51%)
    fills in affected programs: 20378 -> 13489 (-33.81%)
    helped: 295
    HURT: 16

Of course, most of that is in Deus Ex...

Shader-db results on Kaby Lake (without Deus Ex):

    total spills in shared programs: 6479 -> 5834 (-9.96%)
    spills in affected programs: 3231 -> 2586 (-19.96%)
    helped: 40
    HURT: 4

    total fills in shared programs: 17165 -> 17099 (-0.38%)
    fills in affected programs: 6951 -> 6885 (-0.95%)
    helped: 40
    HURT: 7

Even without Deus Ex, the spill help is pretty respectable.  The worst
hurt shaders were one compute shader in Aztec Ruins and one fragment
shader in KSP that were each hurt by around 13% fill 9% spill.

VkPipeline-db results on Kaby Lake:

    total spills in shared programs: 9149 -> 8069 (-11.80%)
    spills in affected programs: 5197 -> 4117 (-20.78%)
    helped: 27
    HURT: 16

    total fills in shared programs: 26390 -> 25477 (-3.46%)
    fills in affected programs: 12662 -> 11749 (-7.21%)
    helped: 24
    HURT: 22

The Vulkan results were decidedly more mixed but we don't have nearly as
many apps in that database yet.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-04-18 23:04:45 +00:00
..
amd ac: use struct/raw store intrinsics for 8-bit/16-bit int with LLVM 9+ 2019-04-17 22:10:30 +02:00
broadcom v3d: Fix atomic cmpxchg in shaders on hardware. 2019-04-18 13:24:55 -07:00
compiler nir/algebraic: Strength reduce some compares of x and -x 2019-04-18 12:37:48 -07:00
egl Delete autotools 2019-04-15 13:44:29 -07:00
freedreno freedreno/ir3: Mark ir3_context_error() as NORETURN 2019-04-18 11:46:13 -07:00
gallium virgl/vtest: bump up protocol version + support encoded transfers 2019-04-18 15:39:23 -07:00
gbm Delete autotools 2019-04-15 13:44:29 -07:00
getopt
glx Delete autotools 2019-04-15 13:44:29 -07:00
gtest Delete autotools 2019-04-15 13:44:29 -07:00
hgl haiku: Fix hgl dispatch build. Tested under meson/scons. 2019-04-02 16:06:00 -05:00
imgui imgui: update memory editor 2019-02-26 12:49:07 +00:00
intel intel/fs: Account for live range lengths in spill costs 2019-04-18 23:04:45 +00:00
loader Delete autotools 2019-04-15 13:44:29 -07:00
mapi Delete autotools 2019-04-15 13:44:29 -07:00
mesa i965: implement WaEnableStateCacheRedirectToCS 2019-04-18 17:43:08 +01:00
util drirc: add Spectacle, Falkon to a-sync blacklist 2019-04-15 17:38:44 -04:00
vulkan Delete autotools 2019-04-15 13:44:29 -07:00
meson.build turnip: Add driver skeleton (v2) 2019-03-11 10:01:15 -07:00
SConscript scons: Remove gles option. 2018-10-19 16:50:26 +01:00