mesa/src
Jason Ekstrand c71c1f44b0 nir/from_ssa: Only chain movs when a src is also a dest
The algorithm we use for resolving parallel copy instructions plays this
little shell game with the values.  The reason for this is that it lets
us handle cases where, for instance we have a -> b and b -> a and we
need to use a temporary to do a swap.  One result of this algorithm is
that it tends to emit a lot of mov chains which are typcially really bad
for GPUs where a mov is far from free.  For instance, it's likely to
turn this:

    r16 = ssa_0; r17 = ssa_0; r18 = ssa_0; r15 = ssa_0

into this:

    r15 = mov ssa_0
    r18 = mov r15
    r17 = mov r18
    r16 = mov r17

which, if it's the only thing in a block (this is common for phis) is
impossible for a scheduler to fix because of the dependencies and you
end up with significant stalling.  If, on the other hand, we only do the
chaining in the actual case where we need to free up a so that it can be
used as a destination, we can emit this:

    r15 = mov ssa_0
    r18 = mov ssa_0
    r17 = mov ssa_0
    r16 = mov ssa_0

which is far nicer to the scheduler.  On Intel, our copy propagation
pass will undo the chain for us so this has no shader-db impact.
However, for less intelligent back-ends, it's probably a lot better.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4412>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4412>
2020-04-02 19:06:46 +00:00
..
amd aco: only break SMEM clauses if XNACK is enabled (mostly APUs) 2020-04-01 17:50:31 +00:00
broadcom meson: inline inc_common 2020-03-28 21:36:54 +01:00
compiler nir/from_ssa: Only chain movs when a src is also a dest 2020-04-02 19:06:46 +00:00
drm-shim meson: inline inc_common 2020-03-28 21:36:54 +01:00
egl gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionally 2020-04-02 14:22:58 +00:00
etnaviv meson: inline inc_common 2020-03-28 21:36:54 +01:00
freedreno freedreno: Rename RB_DONE_TS 2020-04-02 16:18:25 +00:00
gallium freedreno: Rename RB_DONE_TS 2020-04-02 16:18:25 +00:00
gbm meson: move the generic symbols check arguments to a common variable 2019-11-05 20:30:47 +00:00
getopt meson: build getopt when using msvc 2019-09-10 20:36:47 +00:00
glx glx: set the loader_logger early and for everyone 2020-04-01 16:21:32 +01:00
gtest meson: gtest needs pthreads 2019-11-07 06:11:19 -08:00
hgl scons: Prune out unnecessary targets. 2020-03-30 13:38:01 +00:00
imgui meson: drop intel_ prefix on imgui_core 2019-12-10 15:16:02 +00:00
intel anv/image: Use align_u64 for image offsets 2020-04-02 15:08:42 +00:00
loader loader: fallback to kernel name, if PCI fails 2020-04-01 16:57:22 +01:00
mapi scons: Prune out unnecessary targets. 2020-03-30 13:38:01 +00:00
mesa mesa/main: remove unused macro 2020-04-01 12:57:57 +02:00
panfrost pan/bi: Fix outmod/roundmode flip 2020-04-01 02:25:05 +00:00
util driconf: whilelist more games for glthread 2020-04-02 09:55:57 -04:00
vulkan vulkan: drop unused include directories 2020-03-28 21:36:54 +01:00
meson.build meson: inline inc_common 2020-03-28 21:36:54 +01:00
SConscript scons: Prune out unnecessary targets. 2020-03-30 13:38:01 +00:00