intel/fs/xehp: Merge repeated in-order read dependencies instead of replacement.
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 14 Dec 2021 07:48:29 +0000 (23:48 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 25 Jan 2022 22:40:44 +0000 (22:40 +0000)
commit3886e63033b0d8180365e29a1e1e6e9b7549c30e
treebce9ff9cc6e7585235ea2952a5ff5c1854a2f81a
parent4ab663194967fa6da2f98eb6b748bd2e2d969f24
intel/fs/xehp: Merge repeated in-order read dependencies instead of replacement.

Previously the software scoreboard structure would drop previous
dependencies for a given register and replace them with the most
recent one for the same register when a new instruction (or set of
instructions) is processed.  This worked correctly on the Gfx12LP
platforms this code was originally designed for, because a repeated
dependency on the same register would either require the second
instruction to synchronize against the first (so the first dependency
could be disregarded from that point on) *or* require the dependency
to be RaR and in-order, which allows the synchronization to be
optimized out (the first dependency could still be disregarded as
well, since the pipeline is in-order).  However the latter assumption
will break on upcoming Gfx12HP platforms, because they have multiple
asynchronous FPU pipelines, so whenever we hit a RaR dependency we
need to propagate forward both dependencies, since the order in which
both reads will complete is not guaranteed by the hardware in cases
where they occur from different asynchronous pipelines.

Note that this dependency propagation change requires us to change the
definition of dependency::done as well, since that constant is defined
to discard any previous dependency information when used as argument
for shadow().

This has been reported to fix the following conformance failures on DG2:

   KHR-GL46.shaders.uniform_block.random.all_per_block_buffers.19
   dEQP-GLES3.functional.shaders.derivate.fwidth.*

Reported-by: Tapani Pälli <tapani.palli@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5670
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14273>
src/intel/compiler/brw_fs_scoreboard.cpp