i965/fs: Add support for removing MOV.NZ instructions.
authorMatt Turner <mattst88@gmail.com>
Wed, 31 Dec 2014 01:19:41 +0000 (17:19 -0800)
committerMatt Turner <mattst88@gmail.com>
Sat, 24 Jan 2015 01:57:40 +0000 (17:57 -0800)
commit40ae302a3c41d1aa839eb24c429888932f6fee53
tree0d9671cb0fdc24d2c96dc1e536982965f2dd7ab2
parent9a3a2942240065d85e197e04d9612af696b9ea99
i965/fs: Add support for removing MOV.NZ instructions.

For some reason, we occasionally write the flag register with a MOV.NZ
instruction:

   add(8)          g25<1>F         -g6<0,1,0>F     g15<8,8,1>F
   cmp.l.f0(8)     g26<1>D         g25<8,8,1>F     0F
   mov.nz.f0(8)    null            g26<8,8,1>D

A MOV.NZ instruction on the result of a CMP is like comparing for
equality with true in C. It's useless. Removing it allows us to
generate:

   add.l.f0(8)     null            -g6<0,1,0>F     g15<8,8,1>F

total instructions in shared programs: 5955701 -> 5951657 (-0.07%)
instructions in affected programs:     302910 -> 298866 (-1.34%)
GAINED:                                1
LOST:                                  0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp
src/mesa/drivers/dri/i965/test_fs_cmod_propagation.cpp