mesa/src/intel
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
..
blorp intel: Emit 3DSTATE_VF_STATISTICS dynamically 2019-04-14 19:58:04 -07:00
common intel/mi_builder: Disable mem_mem tests on IVB 2019-04-16 12:59:12 -05:00
compiler intel/fs: Account for live range lengths in spill costs 2019-04-18 23:04:45 +00:00
dev i965: move brw_timebase_scale to device info 2019-04-17 14:10:42 +01:00
genxml iris: implement WaEnableStateCacheRedirectToCS 2019-04-18 17:43:08 +01:00
isl intel/isl: Add isl_format_has_color_component() function. 2019-03-20 16:46:25 -07:00
perf intel/perf: constify accumlator parameter 2019-04-17 14:10:42 +01:00
tools intel/tools: Remove redundant definitions of INTEL_DEBUG 2019-04-10 13:15:33 -07:00
vulkan anv: fix uninitialized pthread cond clock domain 2019-04-18 23:23:03 +01:00
Android.blorp.mk intel: android: remove libdrm_intel requirement 2017-03-30 19:07:23 +01:00
Android.common.mk android: static link with libexpat with Android O+ 2019-03-25 10:11:57 +02:00
Android.compiler.mk android: fix build issues with brw_nir_trig_workarounds.c 2017-10-04 07:39:05 +03:00
Android.dev.mk drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
Android.genxml.mk intel/genxml/icl: Generate packing headers 2018-02-15 16:14:55 -08:00
Android.isl.mk android: intel/isl: remove redundant building rules 2019-02-22 07:56:11 +02:00
Android.mk i965: extract performance query metrics 2019-04-17 14:10:42 +01:00
Android.perf.mk i965: extract performance query metrics 2019-04-17 14:10:42 +01:00
Android.vulkan.mk android: static link with libexpat with Android O+ 2019-03-25 10:11:57 +02:00
Makefile.perf.am i965: extract performance query metrics 2019-04-17 14:10:42 +01:00
Makefile.sources intel/compiler: add a NIR pass to lower conversions 2019-04-18 11:05:18 +02:00
meson.build i965: extract performance query metrics 2019-04-17 14:10:42 +01:00