intel/fs/gen12: Workaround unwanted SEND execution due to broken NoMask control flow.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 24 Jan 2020 06:55:33 +0000 (22:55 -0800)
committerFrancisco Jerez <currojerez@riseup.net>
Fri, 14 Feb 2020 22:31:48 +0000 (14:31 -0800)
commita8ac0bd759cbf9a5984df4bc9f553a3dca41a8ab
tree96fd56c250ec04130464d911b0fc2eadfee85a60
parent008f95a043dac909f6e647c3102f37bb978b148c
intel/fs/gen12: Workaround unwanted SEND execution due to broken NoMask control flow.

This is a less invasive alternative to the workaround documented in
the hardware spec for GEN:BUG:1407528679, which doesn't involve
disabling structured control flow (it's unlikely that switching to
GOTO/JOIN would have actually fixed the problem anyway).

Under some conditions Gen12 hardware can end up executing a BB with
all channels disabled, which will lead to the execution of any NoMask
instructions in it, even though any execution-masked instructions will
be correctly shot down.  This may break assumptions of some NoMask
SEND messages whose descriptor depends on data generated by live
invocations of the shader.

This avoids the problem by predicating certain instructions on an ANY
horizontal predicate that makes sure that their execution is omitted
when all channels of the program are disabled.  The shader-db impact
of this patch seems to be minimal:

total instructions in shared programs: 17169833 -> 17169913 (0.00%)
instructions in affected programs: 30663 -> 30743 (0.26%)
helped: 0
HURT: 42

total cycles in shared programs: 336966176 -> 336968568 (0.00%)
cycles in affected programs: 2367290 -> 2369682 (0.10%)
helped: 0
HURT: 13

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Cc: 20.0 <mesa-stable@lists.freedesktop.org>
src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs.h