diff options
author | Matt Turner <mattst88@gmail.com> | 2015-11-30 09:25:19 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2015-12-01 14:48:55 -0800 |
commit | 7e6a6f3e619e7dfed244043a95082f2168a5c953 (patch) | |
tree | 3bbfbb81435b2680d9f567c89b91bb7fb2aa4914 /src/mesa/drivers/dri/i965/brw_cfg.h | |
parent | 5a6f0bf5b810c82b2ddc6c2a9c7cb392d7421eed (diff) | |
download | external_mesa3d-7e6a6f3e619e7dfed244043a95082f2168a5c953.tar.gz external_mesa3d-7e6a6f3e619e7dfed244043a95082f2168a5c953.tar.bz2 external_mesa3d-7e6a6f3e619e7dfed244043a95082f2168a5c953.zip |
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>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_cfg.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_cfg.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h index 69e39e8964..405020b77e 100644 --- a/src/mesa/drivers/dri/i965/brw_cfg.h +++ b/src/mesa/drivers/dri/i965/brw_cfg.h @@ -314,6 +314,9 @@ struct cfg_t { #define foreach_block_safe(__block, __cfg) \ foreach_list_typed_safe (bblock_t, __block, link, &(__cfg)->block_list) +#define foreach_block_reverse_safe(__block, __cfg) \ + foreach_list_typed_reverse_safe (bblock_t, __block, link, &(__cfg)->block_list) + #define foreach_inst_in_block(__type, __inst, __block) \ foreach_in_list(__type, __inst, &(__block)->instructions) |