i965/fs: Add support for removing MOV.NZ instructions

Graphics / Mesa 3D Graphics Library / Mesa - Matt Turner [gmail.com] - 23 January 2015 19:57 UTC

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

40ae302 i965/fs: Add support for removing MOV.NZ instructions.
.../drivers/dri/i965/brw_fs_cmod_propagation.cpp | 23 ++++++++++++--
.../drivers/dri/i965/test_fs_cmod_propagation.cpp | 32 ++++++++++++++++++++
2 files changed, 52 insertions(+), 3 deletions(-)

Upstream: cgit.freedesktop.org


  • Share