intel/fs/ra: Only add MRF hack interference if we're spilling
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 7 May 2019 22:38:22 +0000 (17:38 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 14 May 2019 17:30:22 +0000 (12:30 -0500)
commit47b1dcdcab80db9179e1a28d7f46b98be091bdcf
tree0f3748c20af9ba526f9ffc9da7f8709c60bbdd25
parent69878a9bb0db247553a4eb776f394e6ef509d0cb
intel/fs/ra: Only add MRF hack interference if we're spilling

The only use of the MRF hack these days is for spilling and there we
don't need the precise MRF usage information.  If we're spilling then we
know pretty well how many MRFs are going to be used.  It is possible if
the only things that are spilled have fewer SIMD channels than the
dispatch width of the shader that this may be more MRFs than needed.
That's a risk we're willing to takd.

Shader-db results on Kaby Lake:

    total instructions in shared programs: 15311100 -> 15311224 (<.01%)
    instructions in affected programs: 16664 -> 16788 (0.74%)
    helped: 1
    HURT: 5

    total cycles in shared programs: 355543197 -> 355544739 (<.01%)
    cycles in affected programs: 731864 -> 733406 (0.21%)
    helped: 3
    HURT: 6

The hurt shaders are all SIMD32 compute shaders where we reserve enough
space for a 32-wide spill/fill but don't need it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_fs_reg_allocate.cpp