i965: Use a separate register for every access to an SSA undef.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 29 Jul 2016 08:29:09 +0000 (01:29 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 4 Aug 2016 07:40:10 +0000 (00:40 -0700)
commit12a912586f11ccbc4612532d5ceaf1bdd0cdb45a
treeac76f4daa209bed809f2dc0071d9a484b314bc5f
parent67c5e843b9ae2c72bcf5c84f8744c1bd23fc262a
i965: Use a separate register for every access to an SSA undef.

Previously, we allocated a new VGRF for every undefined definition.
Instead, this patch makes us allocate a new VGRF for every use of an
undefined definition.  This makes sure that undefined values are
fully independent of one another, and have live ranges limited to
their single use.  This allows register coalescing to combine the
source and destination of MOVs from undefined sources, eliminating
the MOV altogether.

On Broadwell:

total instructions in shared programs: 11641187 -> 11640214 (-0.01%)
instructions in affected programs: 70199 -> 69226 (-1.39%)
helped: 213
HURT: 1

v2: Add a comment (based on Iago's suggested one).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_nir.cpp