i965: Do dead-code elimination in a single pass.
authorMatt Turner <mattst88@gmail.com>
Mon, 30 Nov 2015 17:25:19 +0000 (09:25 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 1 Dec 2015 22:48:55 +0000 (14:48 -0800)
commit7e6a6f3e619e7dfed244043a95082f2168a5c953
tree3bbfbb81435b2680d9f567c89b91bb7fb2aa4914
parent5a6f0bf5b810c82b2ddc6c2a9c7cb392d7421eed
i965: Do dead-code elimination in a single pass.

The first pass marked dead instructions as opcode = NOP, and a second
pass deleted those instructions so that the live ranges used in the
first pass wouldn't change.

But since we're walking the instructions in reverse order, we can just
do everything in one pass. The only thing we have to do is walk the
blocks in reverse as well.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_cfg.h
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp
src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp