i965/fs: Track flag register liveness with byte granularity.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 19 May 2016 04:34:27 +0000 (21:34 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Sat, 28 May 2016 06:29:04 +0000 (23:29 -0700)
commit0fec265373f269d116f6d4de900b208fffabe2a1
treef155e9c50dfdec45cf5202017742f2291ff16449
parentdf1aec763eb972c69bc5127be102a9f281ce94f6
i965/fs: Track flag register liveness with byte granularity.

This is required for correctness in presence of multiple 8-wide flag
writes (e.g. 8-wide instructions with a conditional mod set) which
update a different portion of the same 16-bit flag subregister.  Right
now we keep track of flag dataflow with 16-bit granularity and
consider flag writes to have killed any previous definition of the
same subregister even if the write was less than 16 channels wide,
which can cause live flag register updates to be dead code-eliminated
incorrectly.

Additionally this makes sure that we handle 32-wide flag writes and
reads which may span multiple flag subregisters so the current
approach of just setting/testing a single bit from the live set
wouldn't have worked.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp